How to debug PHP mail?
A simple script, simple mail function I called in my localhost and live server.
$message = "Line 1\nLine 2\nLine 3";
$message = wordwrap($message, 70);
$rs = mail('myemail@gmail.com', 'My Subject', $message);
Both of them return bool true. With the localhost, I can receive email but in the live server, I cannot receive any mail.
The开发者_如何学Pythonn I check /var/mail/www-data
there is a message:
Mailing to remote domains not supported
Linux, Apache, or PHP problem?
It seems a smtp server configuration issue, but since you are asking how to debug PHP mail, the best approach would be sniffing the tcp conversation. To do that you can capture the conversation using wireshark (or tcpdump if you are on console) and inspect the actual commands sent to and from the server.
精彩评论