I use following PHP script to send mail:
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
It send mails OK, but sometime it can NOT send mail. I view mail log, and I see the result of send mail (in /var/log/maillog) , for example:
Jul 7 09:15:23 localhost postfix/smtp[32513]: A87A952DC9: to=<testmailabc82@yahoo.co
m.vn>, relay=none, delay=1, status=deferred (connect to mta-v1.mail.vip.sg1.yahoo.
com[124.10
8.116.72]:
server refused to talk to me: 421 Message from (.....MY SERVER IP..) temporarily deferred - 4.16.50. Please refer to
http://help.yahoo.com/help/us/mail/defer/defer-06.html )
I have a question: how to know the result of sendmail immediatly after mail() function of PHP?
Or if have other solution to check mail is deliveried of NOT with PHP code?
(I also have my dedicated MailServer)
Start Free Trial