TIPS:
SMTP and POP3 In Gmail are both SSL-encrypted.
Step1. PHP OpenSSL module (Extension) Support
Step2. download phpmailer Library
Step3. change code 'class. phpmailer. php' and 'class. SMTP. php'
Add property is_ssl (VAR $ is_ssl = false;) to phpmailer and SMTP ;)
The smtpconnect method in phpmailer is passed to the SMTP object ($ this-> SMTP-> is_ssl = $ this-> is_ssl ;)
The Connect Method in SMTP is added before the fsockopen call.
If ($ this-> is_ssl) {$ host = 'ssl: // '. $ host ;}
Write an example to see if OK
$ Mail = new phpmailer ();
$ Mail-> issmtp ();
$ Mail-> encoding = $ this-> encoding;
$ Mail-> host = $ this-> ***; // SMTP servers
$ Mail-> smtpauth = true; // turn on SMTP authentication
$ Mail-> username = $ this-> ***; // SMTP Username
$ Mail-> Password = $ this-> ***; // SMTP Password
$ Mail-> from = $ this-> ***;
$ Mail-> fromname = $ this-> ***;
$ Mail-> addreplyto ($ this-> ***, $ this-> ***);
$ Mail-> charset = $ this-> encoding;
$ Mail-> encoding = "base64 ";
$ Mail-> ishtml (true); // send as HTML
$ Mail-> subject = $ this-> subject;
$ Mail-> body = $ this-> body;
$ Mail-> altbody = "text/html ";
$ Mail-> addaddress ($ to_email );
// $ Mail-> smtpdebug = true;
$ Mail-> is_ssl = true;
$ Mail-> Port = 465;
// Var_dump ($ mail );
// Exit;
$ Mail-> send ();