I just create a php page where user will enter their name in then the page will send them an email with a few word in the body message.
Here is the code:
$fromEmail = "admin@domain.com";
$subject = "Welcome";
$body = "Hi,\n\nYou have visited the page.";
if (mail($Email, $subject, $body, "From: $fromEmail")) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
I even try not to include "From: $fromEmail") in the mail() but still not success. All I receive is "Message delivery failed...".
In the php.ini, I follow the setup in http://au.php.net/manual/en/mail.configuration.php.
** $Email is the variable which will obtain the user email. I even replace that variable with a valid email but the same story.
Do I have to include something?
Thank you.
Enz