PHP sendmail() method delivers mail after 5 minutes - How to Fix?


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.


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

$to      = '';
$subject = 'the subject';
$message = 'hello';
$headers = 'From:' . "\r\n" .
'Reply-To:' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);

if mail get sent fast then server is working fine.