ECMall supports configuring SSL connections to the mail server. First, the phpmailer version used by ecmall is too low and does not support encrypted connections. Then, make some adjustments to the corresponding code. 1. to overwrite phpmailer, download it from the attachment: The first step of the copy generation is that the phpmailer version used by ecmall is too low and does not support encrypted connections.
Then, make some adjustments to the corresponding code.
1. overwrite phpmailer
Download the attachment:
The code is as follows:
Http://cywl.jb51.net: 81/201405/yuanma/ecmall_phpmailer_lib(jb51.netw..zip
2. modify lib
Two lib involved: mail. lib. php and mail_quequ.lib.php
Add a parameter to the constructor of these two classes. For example, Mailer
The code is as follows:
Function _ construct ($ from, $ email, $ protocol, $ host = '', $ port ='', $ user = '', $ pass = '', $ SMTPSecure = false) // add $ SMTPSecure
{
$ This-> Mailer ($ from, $ email, $ protocol, $ host, $ port, $ user, $ pass, $ SMTPSecure );
}
Function Mailer ($ from, $ email, $ protocol, $ host = '', $ port ='', $ user = '', $ pass = '', $ SMTPSecure = false)
....
The same is true for MailQueue.
3. encapsulate the call function
About 300 rows in global. lib. php
Add a row to function & get_mailer:
The code is as follows:
$ Secure = Conf: get ('email _ ssl '); // add this line
$ Mailer = new Mailer ($ sender, $ from, $ protocol, $ host, $ port, $ username, $ password, $ secure); // simultaneously pass parameters
4. adjust the background email settings page and add related settings
Background Template: setting.email_setting.html adds a configuration item
The code is as follows:
Email server encryption method:
{Html_radios name = "email_ssl" options = $ email_ssl checked = $ setting. email_ssl}
This function requires that your php must support the OpenSSL module. if you want to use this function, contact your space provider to confirm that this module is supported.
At the same time, modify the Mail test parameter transmission
The code is as follows: