mail() recipient won't receive the email

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
esandra
Forum Newbie
Posts: 24
Joined: Sun Aug 30, 2009 11:11 pm

mail() recipient won't receive the email

Post 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
stratbeans
Forum Newbie
Posts: 12
Joined: Sat Aug 29, 2009 2:23 am

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

Post 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.
esandra
Forum Newbie
Posts: 24
Joined: Sun Aug 30, 2009 11:11 pm

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

Post by esandra »

how do I check the if I have SMTP support? Where do I do this?
Post Reply