Page 1 of 1

mail() recipient won't receive the email

Posted: Mon Aug 31, 2009 12:05 am
by esandra
This script doesn't return any errors but it doesn't send the email.
Can someone tell me what's wrong with this script?

Code: Select all

 
<?
$email = "esandrkwn@gmail.com";
$subject = "this is a test....";
$message = "If this even gets sent...";
$from = "amarie_kwn@yahoo.com";
 
$headers = "From: ".$from;
 
mail($email,$subject,$message,$headers) or
    Die("Error sending mail :(");
?>
 
Any help will be very much appreciated. Thanks

Re: mail() recipient won't receive the email

Posted: Mon Aug 31, 2009 1:37 am
by stratbeans
Do read http://in.php.net/manual/en/function.mail.php

Regardless, try this out :

1. Remove the optional $header parameter from mail command and try out again.

If ("1 works") {
then, it might be that you have to put "\r\n" at end of your $header string.
}
else {
Check if your server has the SMTP support.
}

Hope this helps.

Re: mail() recipient won't receive the email

Posted: Mon Aug 31, 2009 8:40 am
by esandra
how do I check the if I have SMTP support? Where do I do this?