测试了几个 SMTP 插件都提示 Network is unreachable ,网站能正常访问,也能 ping 。
ifconfig eth0
eth0 Link encap:Ethernet HWaddr 42:01:0a:8c:00:02
inet addr:10.140.0.2 Bcast:10.140.0.2 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1460 Metric:1
RX packets:4282 errors:0 dropped:0 overruns:0 frame:0
TX packets:3423 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1110693 (1.0 MiB) TX bytes:2990663 (2.8 MiB)
Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to smtp.gmail.com:587 (Network is unreachable)
SMTP ERROR: Failed to connect to server: Network is unreachable (101)
SMTP connect() failed.
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting