creating a basic mail client

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
md7dani
Forum Newbie
Posts: 13
Joined: Fri Oct 23, 2009 1:55 am

creating a basic mail client

Post by md7dani »

Just checking how to send a message to any members on a web site. Don't understand the technology behind it; do I need a mail server, how do I get the email address to the member and where will the messages be stored?

This script is for sending an email with php:

<?php
$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>

Need to know where to send the email to any member instead of the static "recipient@example.com".

Note: I mean internal messages within the web site, not to external web clients like @hotmail.com or @yahoo.com

Thanks in advance.
Post Reply