728x90 AdSpace

Latest News
Thursday, October 6, 2016

PHP Sendmail() - mail received after 5 minutes

Problem:

Use sendmail method to send mail to the registered user. Email sends when user registered but it takes 5 minutes to send the mail every time.

Solution:

Try using normal php mail() function to check if its server issue

<?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);
?>

if mail get sent fast then server is working fine.
  • Blogger Comments
  • Facebook Comments

0 comments:

Post a Comment

Item Reviewed: PHP Sendmail() - mail received after 5 minutes Rating: 5 Reviewed By: Thiruvikraman Govindarajan