Jump to content
thirty bees forum

New module "Mail via PHPmailer"


e-com

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?

image.png.ace838150d58083d341a7f7a0b157e2f.png

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:

https://support.google.com/a/answer/176600?hl=en

...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->isSMTP();
    	$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

  • 1 month later...

I try to install the phpmailer module,  i have installed the actual version for Github today,  but there is the following error:

(it says it could not install, because the version is not compatible with my tb version),  i have  tb 1.4.0 and php 7.4.33

what to do? is it really only for  tb 1.5 and above?  i can not send emails at the moment in the 1.4.0 shopversion,  not sure why, so my idea was to try this module.

 

image.png.c650ab96d41ce5d95f2f3e24cd3fa9cf.png

Edited by DRMasterChief
Link to comment
Share on other sites

That's strange I just rolled back my test setup to 1.4 just to confirm and take a screenshot. Probably your module list is cached!?

Those two additional modules are extracted functionality form the core. In 1.4 the email config is here:

image.thumb.png.2155ac2a25f3db76576c64923989f74c.png

And those modules have nowhere to hook to work.

You have to update to 1.5 and this functionality change is just one of the nice features that come with this version.

Link to comment
Share on other sites

Yes, thank you,  i know about the emails.  In my case the templates was gone from all modules /mails,  not sure why.  I now have copied all the mails again from a backup.

I tried an update to 1.5 a few weeks before, but this was not possible  (not absolutely sure what the reason is). 

Link to comment
Share on other sites

Yes,  everything seems ok,  phpMailer is installed;  i am not sure about code minification modules  (HTML, JS and CSS Minification v1.0.0) is not installed yet. 

And i´m not on php 8.x until now,  i have  7.4.33 and this looks good. 

The shop is not "live" at the moment,  but we have to go live april,  so i hope to change to php 8  until then,  but i do not use a standard theme and i am really not sure if it works with php 8.

Link to comment
Share on other sites

Install the minification module too, otherwise you will not have this function. This was also extracted from the core, like the email transport method.

Nothing to break, don't worry!

7.4 is OK, as 8 brings lot more changes and you will have troubles for sure with it.

Also install Collect PHP Logs module and monitor there what errors you get so they can be fixed.

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...