View Full Version : Email not delivering....

07-03-2007, 06:24 AM
This is my code .It is executing and not showing any error messages, but email is not delivering ..

Cud any one of you please contibute your valuble time for me???
I am using PHP 4.3.10 , Mysql 4.1.9 with windows server. Is there any need to change the ini settings.If so, cud u intimate me what should i change??

"purush2purush@yahoo.co.in", // E-Mail address
"Hay.......", // Subject
"Thanks 4 ur help???", // Message
"From: mahela <mahela@yahoo.co.in>\r\nReply-to: jaswani <jaswani@hotmail.com>");
echo "Mail Sent Sucessfully";

Thanks & regards,

07-03-2007, 07:01 AM

$email = "you@domain.com";
$subject = "Hay";
$message = "Thanks 4 ur help???";
$headers = "From: mahela <someone@yahoo.co.in>\r\n";
$headers .= "Reply-to: jaswani <someone@hotmail.com>";

// this statement below is called a ternary conditional
echo (mail($email,$subject,$message,$headers)) ? 'Mail Sent Successfully' : 'Mail sending has failed';
More info on ternary here: http://www.ilovejackdaniels.com/php/ternary-conditionals/

If the above doesn't work then your host may have disabled the mail function. Many free webhosts do this often.

Note: I've removed the emails from the post I made to prevent spam, I suggest you do the same.

07-03-2007, 01:15 PM
Tried with the code you suggested..Then the following error message is displayed...

Warning: mail(): SMTP server response: 530 5.7.0 Must issue a STARTTLS command first y25sm7200507pod in c:\program files\php\www\testtest.php on line 9
Mail sending has failed

Will be greatful..If i get reply ..

Thanks & regards,

07-04-2007, 12:18 PM
Hay ..cud any one plz solve this problem..

I even upgraded my Php..Even then mail is not able to sent.

I am trying to send through gmail with smtp.gmail.com

07-04-2007, 02:56 PM
Please read the information at this link on how to connect and send mail through gmail - http://mail.google.com/support/bin/answer.py?answer=13287

You need to use SMTP authentication and connect through an SSL port.

The PHP mail(...) function does not support SMTP authentication. You would need to use the phpmailer class or other mail class that supports authentication.

07-05-2007, 11:44 AM
Even a small help for One,may become a great help for others..

Very very thanks for your help...

Thanks & regards,