Jump to content
thirty bees forum

New module "Mail via PHPmailer"


Recommended Posts

Module implements mail functionality using PHPMailer library.
Module compatible with thirty bees 1.5.0 bleeding edge and already available in list of native modules.
PHPMailer library is compatible with PHP 8.2, also it is worth replacing "Mail via swiftmailer" module with this module.


  • Like 5
  • Thanks 2
Link to comment
Share on other sites

  • 4 months later...

I'm trying it configuring google workspace routing without success.

It replies with:

Send Email Error: SMTP Error: Could not authenticate. 

Is it normal that the password in the smtp password field of the module configuration is visible?


Link to comment
Share on other sites

20 hours ago, the.rampage.rado said:

I think your smtp server is not right. Please, check it first. This error is not related to the visible pass in BO. Google has no eyes there 🙂

The SMTP is right I followed option 1 and option 2  here:


...but this days are so hot here in Italy that maybe I'm following the wrong guides 🥵

Link to comment
Share on other sites

As said in the previous post, I tried both. number 1 and number 2 options.

Some time ago gmail lt create app password, but as far I see now it's not. maybe they deprecated?

How maybe I see, I think I need to activate 2 step auth for that account, I'm going to try asap and update this thread.

Link to comment
Share on other sites

  • 3 months later...

Request Advanced Options Fields for Mail via PHPMailer Module

I have one of my installations hosted on a Linux server with cPanel on GoDaddy.  Don't ever use GoDaddy!  The Outgoing SMTP requirements are almost impossible to set.  I have finally figured out a working configuration for sending email in WordPress, and as a result am requesting some "advanced" options be added to the Mail via PHPMailer module. The current module will not support SMTP for GoDaddy, unless additional fields are included.

Advanced Options fields requested:

  • SMTPAutoTLS (boolean) - default to true,  needs to be false for GoDaddy
  • SMTPAuth (boolean) - default to true, needs to be false for GoDaddy

Additionally it is requested that the option to use PHP's mail() function, be available as a setup option, similar to the Mail via Swiftmail module.  This makes it easier to troubleshoot mail settings. 

For supporting information, the following is what I was able to get working in the WordPress wp_config file with the defined constants loaded via PHP code in the separate file below it.

// SMTP Authentication replaces PHP mail
define( 'SMTP_USER',   'authenticated_email_account@domain.com' );    // Username to use for SMTP authentication
define( 'SMTP_PASS',   'mypassword' );  // Password to use for SMTP authentication
define( 'SMTP_FROM',   'your_desired_email@domain.com' ); // SMTP From email address
define( 'SMTP_NAME',   'John Smith' );  // SMTP From name
define( 'SMTP_HOST',   'localhost'); //'localhost' for GoDaddy Linux cPanel hosting
define( 'SMTP_PORT',   '25' );       // 25 for GoDaddy SMTP port number - 465 or 587 will not work on GoDaddy
define( 'SMTP_AUTOTLS',    false );  // false required for GoDaddy
define( 'SMTP_SECURE', '' );         // blank for GoDaddy Encryption system to use - ssl or tls will not work on Godaddy
define( 'SMTP_AUTH',    false );     // false for GoDaddy Use SMTP authentication (true|false) - GoDaddy requires false where most everywhere else true
define( 'SMTP_DEBUG',   0 );         // for debugging purposes only set to 1 or 2

This is the PHP code in WordPress that sets up the SMTP

// SMTP Authentication to replace PHP Mailer
    add_action( 'phpmailer_init', 'send_smtp_email' );
    function send_smtp_email( $phpmailer ) {
    	$phpmailer->Host       = SMTP_HOST;
    	$phpmailer->SMTPAuth   = SMTP_AUTH;
    	$phpmailer->Port       = SMTP_PORT;
    	$phpmailer->Username   = SMTP_USER;
    	$phpmailer->Password   = SMTP_PASS;
    	$phpmailer->SMTPSecure = SMTP_SECURE;
    	$phpmailer->SMTPAutoTLS = SMTP_AUTOTLS; // required for GoDaddy
    	$phpmailer->From       = SMTP_FROM;
    	$phpmailer->FromName   = SMTP_NAME;
    } // end function send_smtp_email( $phpmailer )


Edited by Rhapsody
added use PHP's mail() function comment
Link to comment
Share on other sites

  • 1 month later...

@datakick An update on the GoDaddy email configuration. It turns out the additional fields are not needed in the "Mail via PHPmailer" module.  I did some more testing and found that the SMTP server must be set to the actual mail server on the "Mail via PHPmailer" module or there is an SSL certifcate validation issue.  The "Mail via Swiftmailer" module worked with local host, probably because the SSL certificate validation was not enforced.

I'm not sure how I can remove the enhancement request from Github.  Possibly just a follow on comment that the additional fields are not required.

The option to use PHP Mail() for testing should remain.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...