我正在尝试使用phpmailer类从outlook smtp发送电子邮件。我收到以下错误。
2017-07-18 09:19:33 Connection: opening to ssl://smtp.office365.com:587, timeout=300, options=array ( 'ssl' => array ('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ),
)
2017-07-18 09:19:34 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol [/var/www/html/application/third_party/phpmailer/class.smtp.php line 294]
2017-07-18 09:19:34 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/var/www/html/application/third_party/phpmailer/class.smtp.php line 294]
2017-07-18 09:19:34 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) [/var/www/html/application/third_party/phpmailer/class.smtp.php line 294]
2017-07-18 09:19:34 SMTP ERROR: Failed to connect to server: (0)
2017-07-18 09:19:34 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
有人可以帮我这个???
答案 0 :(得分:2)
在您撰写此问题时,您可以点击错误消息中包含的链接,该链接会显示一个页面,告诉您如何解决此错误。
您不能SMTPSecure = 'ssl'
使用Port = 587
;设置SMTPSecure = 'tls'
。