开发者

How to debug PHP mail?

开发者 https://www.devze.com 2023-04-11 22:33 出处:网络
A simple script, simple mail function I called in my localhost and live server. $message = \"Line 1\\nLine 2\\nLine 3\";

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号