My script.php
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$to = 'myemail@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: anotheremail@domain.com' . "\r\n" .
'Reply-To: anotheremail@domain.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$res = mail($to, $subject, $message, $headers);
var_dump($res);
?>
php.ini essentials
sendmail_path = /usr/sbin/sendmail -t -i
mail.log = /home/myuser/phpmail.log
- When I run script.php it takes about 30 seconds before it displays bool(true).
- /home/myuser/phpmail.log contains entry with all headers
- /usr/sbin/sendmail is the correct path to sendmail
- The email does not get through. Tested several different addresses e.g. mailinator
How do I get it to work? What can i do to debug?