Sendmail wont work with PHP
$to = '
$subject = 'Test email using PHP';
$message = 'This is a test email message';
$headers = 'From:
'Reply-To:
'X-Mailer: PHP/' . phpversion();
if(mail($to, $subject, $message, $headers, '-
echo 'Successfully sent email to queue.';
else
echo 'Error, mail was not sent to queue.';
?>
Returns:
Successfully sent email to queue.
tail -f /var/log/maillog:
Jun 26 21:32:38 sr2 postfix/smtp[5121]: connect to ASPMX2.GOOGLEMAIL.COM[74.125.142.27]:25: Connection timed out
Jun 26 21:32:38 sr2 postfix/smtp[5121]: 9307840CEF: to=<
Jun 26 21:32:38 sr2 postfix/smtp[5122]: connect to alt4.gmail-smtp-in.l.google.com[74.125.131.26]:25: Connection timed out
How do I force it to use port 587?
2 Replies
This howto