mailwizz在配置gmail的smtp server 时,端口选择587 ,协议什么都不选情况下,可能会报错:
Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to starttls://smtp.gmail.com:587 (Unable to find the socket transport "starttls" - did you forget to enable it when you configured PHP?)
Log data:
++ Starting Swift_SmtpTransport
!! Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to starttls://smtp.gmail.com:587 (Unable to find the socket transport "starttls" - did you forget to enable it when you configured PHP?) (code: 0)
官方论坛讨论地址:https://serverfault.com/questions/811912/can-nginx-location-blocks-match-a-url-query-string,最终原因是starttls的兼容性问题:
If your smtp server require encryption, you should use tls not starttls, starttls is some old backward compatibility setting.
所以,选择tls就好了。