简体   繁体   中英

issue in sending email using outlook smtp with phpmailer class

I am trying to send email from outlook smtp using phpmailer class. I am getting the following error.

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

Can some one help me on this???

In the time it took you to write this question, you could have clicked the link that's included in the error message which takes you a page that tells you how to fix this this exact error.

You can't use SMTPSecure = 'ssl' with Port = 587 ; Set SMTPSecure = 'tls' .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM