creating a basic mail client
Posted: Mon Oct 26, 2009 7:24 pm
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.
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.