Phpmailer Configure SSL to connect to SMTP server failed solution

Source: Internet
Author: User
Tags ini openssl

Using Phpmailer to send messages uses an unencrypted SMTP server, and the SMTP server used this time is connected using SSL (secure Sockets Layer, Secure Sockets Layer).

Fortunately, Phpmailer support SSL SMTP server, online data, thought that the lower mouth, plus smtpsecure settings on it, but the fact is not so.

The port in the code is changed to 465, plus $mail->smtpsecure = "SSL"; setting, the result Phpmailer has been prompted not to connect to the host.

Online all kinds of information, all kinds of consultation, after a variety of toss finally found the reason, PHP did not open OpenSSL expansion, Khan ...

windows open OpenSSL Extension

Found in php.ini file, Extension=php_openssl.dll, remove the "semicolon" from the front, and restart Apache.

Linux opens OpenSSL extension

CD php-5.2.14/ext/openssl/
MV Config0.m4 CONFIG.M4
Phpize
./configure
Make
Make install

Modify the php.ini file and add it in the appropriate location

Extension=openssl.so

A USR2 signal was sent to the PHP-FPM master process, and the SSL extension was added successfully.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.