Replies: 0
Like, evidently, many others, I’ve been having real issues with setting this plugin up to work with G Suite. It sends emails fine but they always send from my main G Suite address and profile picture rather than the alias which I wanted it to.
I’ve been round the houses for weeks trying to find a solution to this problem but, while it seems like something that a lot of others were having issues with, no one had a solution.
Well, in case it helps anyone else, I’ve got it working. It will only work for G Suite so I’m afraid I can’t help with regular Gmail accounts but here’s how I did it.
In G Suite Admin, go to Apps/G Suite/Gmail then scroll down and select ‘Advanced Settings’. From there, look for ‘SMTP relay service’.
Enable the service then set the following, deleting [square brackets] and replacing with your info:
Allowed senders: Only addresses in my domains
Only accept mail from the specified IP addresses: [OPTIONAL, BUT RECOMMENDED]
Allowed IP addresses: [IF YOU SAID YES ABOVE, PUT YOUR SERVER IP HERE]
Require SMTP Authentication: Yes
Require TLS encryption: Yes.
Then open up the wp-config.php file of your site and put the following at the bottom:
define( ‘WPMS_ON’, true );
define( ‘WPMS_LICENSE_KEY’, ” );
define( ‘WPMS_MAIL_FROM’, ‘[REPLACE WITH THE ADDRESS YOU WANT TO SEND FROM]’ );
define( ‘WPMS_MAIL_FROM_FORCE’, true );
define( ‘WPMS_MAIL_FROM_NAME’, ‘[PUT THE DESIRED SENDER NAME]’ );
define( ‘WPMS_MAIL_FROM_NAME_FORCE’, true );
define( ‘WPMS_MAILER’, ‘smtp’ );
define( ‘WPMS_SET_RETURN_PATH’, true );
define( ‘WPMS_DO_NOT_SEND’, false );
define( ‘WPMS_SMTP_HOST’, ‘smtp-relay.gmail.com’ );
define( ‘WPMS_SMTP_PORT’, 587 );
define( ‘WPMS_SSL’, ‘tls’ );
define( ‘WPMS_SMTP_AUTH’, true );
define( ‘WPMS_SMTP_USER’, ‘[YOUR GSUITE LOGIN EMAIL ADDRESS]’ );
define( ‘WPMS_SMTP_PASS’, ‘[YOUR GSUITE PASSWORD]’ );
define( ‘WPMS_SMTP_AUTOTLS’, true );
Note the smtp host is smtp-relay.gmail.com, not the usual smtp.gmail.com.
Obviously, it would be nice to use OAuth instead of having to hard-code my GSuite password into wp-config but as G SUite Support told me, the GMail API isn’t officially supported by GSuite. And it works, so I’ll take it as a win for now.
Hope it helps someone.