phplist SMTP w/ SSL

Update (Nov 25, 2013): Instructions for version 3.0.5

1. Rename config_extended.php to config.php

2. Uncomment line 558.

define("PHPMAILER_SECURE",'ssl');

3. Set mail server on line 535.

define("PHPMAILERHOST",'smtp.yourdomain.com');

4. Uncomment line 543, 544, 547.

Fill in the username, password and SSL port number.

5. Set line 213 to 0.

define ("TEST",0);

The above steps should be all you need to do to setup SMTP w/ SSL on the current version. There is no longer a need to edit any file other than config.php.

Update (Aug 18, 2013): The newest version of phpList’s config.php has settings for using secure SMTP. I suggest you use the new config file by copying your settings from the old config file. Enjoy!

Update (Nov 20, 2012): This still works for 2.10.19! 🙂

Update (Nov 7, 2011): I just upgraded to 2.10.17 and can confirm this still works.

Original Post (Jun 7, 2011): When I updated phplist to 2.10.14 I forgot that there were a few modifications required for using SMTP with SSL. This may be the reason your phplist will not send mail.

Searching resulted in many forum threads which had numerous suggestions. I checked the old files and found that the following modifications, in the past, had allowed me to send mail via SMTP with SSL.

config/config.php settings:

define("PHPMAILER",1);
define("PHPMAILERHOST",'smtp.yourdomain.com');
$phpmailer_smtpuser = 'LOGIN';
$phpmailer_smtppassword = 'PASSWORD';
$phpmailer_smtpsecure = 'ssl';
$phpmailer_smtpport = 465;

Open admin/class.phplistmailer.php and locate:

$this->Password = $GLOBALS['phpmailer_smtppassword'];

Below it insert:

$this->SMTPSecure = $GLOBALS['phpmailer_smtpsecure'];
$this->Port = $GLOBALS['phpmailer_smtpport'];

Open admin/phpmailer/class.smtp.php and locate:

$this->smtp_conn = fsockopen($host,

Update

$host,

to

$host='ssl://smtp.yourdomain.com',

You should now be able to send mail!!

17 Replies to “phplist SMTP w/ SSL”

  1. Hi, in my config.php I don’t found these line:
    “$phpmailer_smtpsecure = ‘ssl’;
    $phpmailer_smtpport = 465;”.
    I must insert them by myself?

    1. The line in the new version’s config.php is define("PHPMAILER_SECURE",'ssl');. Just uncomment that line, you don’t have to add anything. A few lines above this you can set your mail server and port.

      1. Me again, sorry…
        in PhpList 3.0.2 config.php I’m not able to find any comment or uncomment line as define(“PHPMAILER_SECURE”,’ssl’);
        I looked for any reference to server and port, too. Also in this case I didn’t find any code line to set these parameters.
        I’m looking in the wrong place?
        Thanks for your help

        1. I just downloaded the latest version which is 3.0.5. It looks like the config file structure has changed recently. The location of the line is config_extended.php on line 558.

          1. Thanks again for your reply!
            I made the same: I uploaded PhpList to 3.0.5 and I’d like to fix all the things to do on this version to use PhpList with a transactional emails service like MailJet, SendGrid and Mandril (MailChimp).
            I do it for me and “descendants” :-))
            Please, help me understand if I’m doing the right things.

            (1)
            First of all: I suppose that it is necessary to rename “config.php” with something like “config_simpy.php” and then “config_extended.php” in “config.php”. In this way I use the more configurable version of the config.php file. Is it correct?

            (2)
            On our new config.php file:
            [on line 535]: define(“PHPMAILERHOST”,’smtp.yourdomain.com’);
            [on line 543]: $phpmailer_smtpuser = ‘LOGIN’;
            [on line 544]: $phpmailer_smtppassword = ‘PASSWORD’;
            [on line 557]: if you need, uncomment and set a different port;
            [on line 558]: uncomment #define(“PHPMAILER_SECURE”,’ssl’);

            (3)
            On admin/class.phplistmailer.php locate [line 94]:
            $this->Password = $GLOBALS[‘phpmailer_smtppassword’];
            Below it insert:
            $this->SMTPSecure = $GLOBALS[‘phpmailer_smtpsecure’];
            $this->Port = $GLOBALS[‘phpmailer_smtpport’];

            (4)
            Open admin/PHPMailer-5.2.5/class.smtp.php and locate:
            $this->smtp_conn = fsockopen($host,
            Update
            $host,
            to
            $host=’ssl://smtp.yourdomain.com’,

            (5)
            PLEASE NOTE: I don’t find any option to set:
            define(“PHPMAILER”,1);
            Is it still necessary in this last PhpList version?

            Thanks again, and again, for your fundamental help.

          2. 1. Yes, rename config_extended.php to config.php

            2. Uncomment line 558.
            define("PHPMAILER_SECURE",'ssl');

            3. Set mail server on line 535.
            define("PHPMAILERHOST",'smtp.yourdomain.com');

            4. Uncomment line 543, 544, 547.
            Fill in the username, password and SSL port number.

            5. Set line 213 to 0.
            define ("TEST",0);

            The above steps should be all you need to do to setup SMTP w/ SSL on the current version. There is no longer a need to edit any file other than config.php.

  2. I have tried everything you have mentioned in this article, including the comment above with the steps to changing config_extended.php to config.php. The send test says that it was successful, but I am still waiting for anything to appear in my inbox. I sent the test to my gmail and there is nothing in spam either.

    Just frustrated, as I am trying to migrate this client from pommo which isn’t working anymore, to PhpLists.

    Any suggestions would be appreciated.

    1. By now if the email hasn’t arrived, check your SMTP settings. Are you trying to use a local mail server? Try using Gmail’s SMTP server.

    2. so instead of using:

      define(“PHPMAILERHOST”,’mail.mysite.com’);
      $phpmailer_smtpuser = ‘newsletters@mysite.com’;
      $phpmailer_smtppassword = ‘xxxxxxx’;
      define(‘PHPMAILERPORT’,465);
      define(“PHPMAILER_SECURE”,’ssl’);

      I should set up a gmail for sending?

    3. Did you make sure to set define ("TEST",0);? I am not sure how your email server is setup. I think it would give an error message instead of saying successful if some criteria not met, like the from address not being hosted on the SMTP server. I would try using an email server with credentials (including from address) that I know to work for outbound mail. I would also check my webserver’s log file for errors. If I still can’t get it, I would try enabling debugging in phplist to see if it has any useful output. Scroll to the bottom of this page, it is second from the bottom, error level.

      Please let me know what the problem was when you get it working!

      Regards.

    4. Yep, the TEST setting is set to 0.
      I even set up a Gmail address and tried to change the settings to that, and it still will not work. I did find some info on another forum where once the guy set up 2 step verification, the gmail settings worked. So I am going to try that, see if that will help.

      The site is hosted on hostmonster and I created an email address called newsletters@ for sending these emails.

      Its frustrating because I should be able to figure this thing out. 😉

      I will let you know what does end up working.

      1. I hate to say that I had to uninstall the app. The next morning when I tried to get back into it, the admin password had changed somehow, and I had struggled for 2 days to get the email to work with no luck. I have another invoicing app that worked on the first try to connect to smtp… not sure what happened. I set up my client with MailChimp because I needed to get a solution for them.

        I will keep PHPLists in mind for the future. Its a great looking program!

Leave a Reply

Your email address will not be published. Required fields are marked *