PhpList with SMTP Google Account

I was trying to setup PhpList with my Gmail account. First I tried it with sendmail (default), it was working fine. But when I tried to setup outgoing mails to use my Gmail smtp account, I couldn’t find any setting for this in its admin area (I think they should have it in their admin section). Though I found options to set smtp as mailer in configuration file (/config/config.php), but Gmail smtp uses secure connection to relay mails, but there was no option to set port & smtp secure.

So I added two more lines in configuration file (/config/config.php).

$phpmailer_smtpport = 465;
$phpmailer_smtpsecure = 'ssl';

As I added two more setting variables, then they must be used in

the class where its taking smtp params. So, I added a small code block in /admin/class.phplistmailer.php.

if ( isset($GLOBALS['phpmailer_smtpport']) ) {
$this->Port = $GLOBALS['phpmailer_smtpport'];
if ( isset($GLOBALS['phpmailer_smtpsecure']) ) {
$this->SMTPSecure = $GLOBALS['phpmailer_smtpsecure'];

..just above this line

$this->Mailer = "smtp";

And I tried again by sending a test email from admin area, but failed.
I again digged into the code to find issue, then I found that phplist uses a very popular & excellent mailer class phpmailer, but they were using quite older version of phpmailer class, so I updated phpmailer class (overwritten all content inside phpmailer folder with new one) with the latest one.

And then it worked like a charm.

Read More