Setting up phpList with Thexyz SMTP Server

edited August 14 in Web Development

This post will show s to configure phpList to use your Thexyz Email Account to send email messages with SMTP.

Adjust the example below for your needs. Make sure you change the following variables:

    smtpuser: your email address at Thexyz.
    smtppassword: your email password for Thexyz.

Edit config.php file usually located under /lists/config/ folder. Search for the following code:

If you want to use the PHPMailer class from phpmailer.sourceforge.net, set the following
 to 1. If you tend to send out html emails, it is recommended to do so.
define("PHPMAILER",1);

 To use a SMTP please give your server hostname here, leave it blank to use the standard
 PHP mail() command.
define("PHPMAILERHOST",'');

 if you want to use smtp authentication when sending the email uncomment the following# two lines and set the username and password to be the correct ones
$phpmailer_smtpuser = 'smtpuser';
$phpmailer_smtppassword = 'smtppassword';

Replace with the following code:

`If you want to use the PHPMailer class from phpmailer.sourceforge.net, set the following
to 1. If you tend to send out html emails, it is recommended to do so.
define("PHPMAILER",1);

To use a SMTP please give your server hostname here, leave it blank to use the standard
PHP mail() command.
define("PHPMAILERHOST",'smtp.emailsrvr.com');

if you want to use smtp authentication when sending the email uncomment the following
two lines and set the username and password to be the correct ones
$phpmailer_smtpuser = 'smtpuser';
// Enter your full email address with Thexyz.

$phpmailer_smtppassword = 'smtppassword';
// Enter your Thexyz Email Password.

$phpmailer_smtpport = '25';
// 8025, 587, 465 and 2525 can also be used
$phpmailer_smtpsecure = 'false';`

The final step is to edit the file /lists/admin/class.phplistmailer.php. Search for the following lines of code:

if (isset($GLOBALS['phpmailer_smtpuser']) && $GLOBALS['phpmailer_smtpuser'] != '') {
$this->SMTPAuth = true;
$this->Username = $GLOBALS['phpmailer_smtpuser'];
$this->Password = $GLOBALS['phpmailer_smtppassword'];

Add this line of code:

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

Sign In or Register to comment.