Settings for SMPT with Gmail

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Vasile Borza
Registered User
Posts: 9
Joined: Thu Mar 09, 2017 3:52 pm

Settings for SMPT with Gmail

Post by Vasile Borza » Thu Mar 09, 2017 5:49 pm

I worked three days to understand the necessary settings for SMTP email sent via the gmail account. I use phpBB 3.2.0, Fedora 25 and MariaDB, php 7.02. There is a known bug that I reported: the button "Send a test email" is not working.
Finally settings that everything is okay, are these:

Contact email address: username@gmail.com
Return email address: username@gmail.com
Use SMTP server for email: Yes
SMTP server address: smtp.gmail.com (without ssl: !!)
SMTP server port: 587
Authentication method for SMTP: LOGIN
SMTP username: username@gmail.com
SMTP password: password
For me any other settings like 465 port or ssl://smtp.gmail.com, or tsl://.. or PLAIN , or any combination is not working.

Explode!
Registered User
Posts: 47
Joined: Mon Nov 26, 2007 10:06 am

Re: Settings for SMPT with Gmail

Post by Explode! » Wed Jun 13, 2018 7:37 am

I found this thread while looking up the best configuration to use a Gmail account for email delivery and thought I'd add an update to the OP.

phpBB 3.2.2
php 7.0.3
Ubuntu 16.04.1

I used all of the settings mentioned in my configuration and emails would not work. I found that Gmail have introduced a security setting to prevent less secure access, which this is classed as.

To get things working you need to log in to the Gmail account you're using and from this page: https://myaccount.google.com/security change "Allow less secure apps" to ON.

If like me your email account is managed through G-Suite then you'll first have to allow the user to do this from the Admin Centre Security Settings. "Allow users to manage their access to less secure apps".

Once I'd done this the "Send test email" was delivered to my board admin account and new registration emails were successfully received.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21578
Joined: Fri Aug 29, 2008 9:49 am
Location: Caerdydd

Re: Settings for SMPT with Gmail

Post by Mick » Wed Jun 13, 2018 7:52 am

If you continue having mail issues try using the PHP mail() function (SMTP off) and don’t use “free” email addresses but use an email address supplied by your host admin@mydomain.com for example.

Is there any specific reason you want to use SMTP?
"The more connected we get the more alone we become" - Kyle Broflovski

Explode!
Registered User
Posts: 47
Joined: Mon Nov 26, 2007 10:06 am

Re: Settings for SMPT with Gmail

Post by Explode! » Wed Jun 13, 2018 8:02 am

Hi Mick, thanks for the reply, the mail is working fine through SMTP. I was just reporting back what I did to get it working :)

I am not using an @freedomain.com - I'm nowusing SMTP because regardless of my SPF settings mail delivery directly out of the server hosting the board to new or existing members has always been sketchy.

Using the authenticated login it will be sent from the account itself hence the delivery should be more reliable.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21578
Joined: Fri Aug 29, 2008 9:49 am
Location: Caerdydd

Re: Settings for SMPT with Gmail

Post by Mick » Wed Jun 13, 2018 8:14 am

No worries it’s good you have it working👍🏼

I had an SMTP set up that had been sketchy for a long time, some emails it sent others it didn’t including the test mail. Changing to non SMTP and using a domain email miraculously made it all work.
"The more connected we get the more alone we become" - Kyle Broflovski

User avatar
Lumpy Burgertushie
Registered User
Posts: 66734
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Settings for SMPT with Gmail

Post by Lumpy Burgertushie » Wed Jun 13, 2018 3:11 pm

gmail is a free email

the point is to use a email at your host like you@yourdomain.com

many hosts do not allow relaying email through their server from any other server much less something like gmail or hotmail or other free email providers.
it is always best to use a email address at the domain you are on.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Explode!
Registered User
Posts: 47
Joined: Mon Nov 26, 2007 10:06 am

Re: Settings for SMPT with Gmail

Post by Explode! » Wed Jun 13, 2018 3:45 pm

Hi Robert,

You're not right there, Gmail can be used for business through G-Suite which allows you to use your own @yourdomain.com as I mentioned earlier in the thread and this is how I'm configured.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66734
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Settings for SMPT with Gmail

Post by Lumpy Burgertushie » Wed Jun 13, 2018 3:54 pm

gmail can be used for anything but it remains that it is a free email provider.

I don't understand what the other part means. if you are using your gmail address for the smtp in your board then you are not using the smtp server at your host nor are you using the built in php mail of your host.

uncheck smtp, don't use gmail at all. create ( if you haven't already ) a board email account on your host and use that for the board email in the settings area of the admin panel.

test, see what happens. remember none of this has anything to do with gmail for the test.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21578
Joined: Fri Aug 29, 2008 9:49 am
Location: Caerdydd

Re: Settings for SMPT with Gmail

Post by Mick » Wed Jun 13, 2018 4:18 pm

Lumpy Burgertushie wrote:
Wed Jun 13, 2018 3:11 pm
it is always best to use a email address at the domain you are on
After several years reading you say this and my recent similar issues I have to say I think you’re correct. My sketchy email set up suddenly burst in to life after I started using my domain email address. I’m not saying why this is, I don’t know but it’s worked on two boards with email issues in the last three days.
"The more connected we get the more alone we become" - Kyle Broflovski

Explode!
Registered User
Posts: 47
Joined: Mon Nov 26, 2007 10:06 am

Re: Settings for SMPT with Gmail

Post by Explode! » Wed Jun 13, 2018 4:59 pm

Robert, G-Suite isn't free, it's a service from Google to host your own domain there for emails much like Office365 from Microsoft. It has nothing to do with free Gmail accounts.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66734
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Settings for SMPT with Gmail

Post by Lumpy Burgertushie » Wed Jun 13, 2018 7:27 pm

Explode! wrote:
Wed Jun 13, 2018 4:59 pm
Robert, G-Suite isn't free, it's a service from Google to host your own domain there for emails much like Office365 from Microsoft. It has nothing to do with free Gmail accounts.
ok, why not try what we are suggesting to see what happens. shouldn't take more than a couple of minutes and then you will know.
besides, if you already have a email address at yourdomain for the board why are you using gmail to begin with? you can simply create a forward for your board email to your gmail etc.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Explode!
Registered User
Posts: 47
Joined: Mon Nov 26, 2007 10:06 am

Re: Settings for SMPT with Gmail

Post by Explode! » Wed Jun 13, 2018 7:29 pm

I don't have any problems, what do I need to try?

My settings are great.

STN
Registered User
Posts: 14
Joined: Sat Sep 04, 2010 8:25 pm

Re: Settings for SMPT with Gmail

Post by STN » Tue May 21, 2019 8:20 am

Vasile Borza wrote:
Thu Mar 09, 2017 5:49 pm
I worked three days to understand the necessary settings for SMTP email sent via the gmail account. I use phpBB 3.2.0, Fedora 25 and MariaDB, php 7.02. There is a known bug that I reported: the button "Send a test email" is not working.
Finally settings that everything is okay, are these:

Contact email address: username@gmail.com
Return email address: username@gmail.com
Use SMTP server for email: Yes
SMTP server address: smtp.gmail.com (without ssl: !!)
SMTP server port: 587
Authentication method for SMTP: LOGIN
SMTP username: username@gmail.com
SMTP password: password
For me any other settings like 465 port or ssl://smtp.gmail.com, or tsl://.. or PLAIN , or any combination is not working.
Thank you! This worked like a charm.

I have been trying for past couple of hours to make smtp work with Gsuite to no avail until changing the port from 465 to 587

Loomborn
Registered User
Posts: 38
Joined: Sat Sep 20, 2008 5:48 am

Re: Settings for SMPT with Gmail

Post by Loomborn » Fri Aug 09, 2019 6:58 pm

Hello! So, from what little I understand of this, would it be possible to use GSuites to send emails to all my forum members from the ACP’s “send mass email” button?

User avatar
EA117
Registered User
Posts: 939
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Settings for SMPT with Gmail

Post by EA117 » Fri Aug 09, 2019 8:45 pm

Loomborn wrote:
Fri Aug 09, 2019 6:58 pm
...would it be possible to use GSuites to send emails to all my forum members from the ACP’s “send mass email” button?
It appears that at least back in 2018 when this discussion was occurring, in order to send SMTP email using the Google Gmail SMTP servers, you had to first enable "Allow less secure apps" in the Gmail account settings, in order to allow the SMTP access to work "at all." I'm not a Gmail user who would know first-hand, but I presume that's still true.

Someone who used Google G-Suites to manage their email (instead of just a regular Gmail account) confirmed that the same was true for a G-Suites managed email account. Except that the setting was found in the G-Suites Admin Centre Security Settings, and was called "Allow users to manage their access to less secure apps". So if you have a G-Suites managed email account, presumably that's where you can expect to find this same setting.

If your phpBB site is able to use an external SMTP server at all (meaning, your hosting service doesn't block external SMTP communication, and doesn't force you to use the SMTP or PHP mail() service available on localhost), then it should be able to use a Google G-Suite managed email account's SMTP access, too.

Because "it's just another external SMTP server" from phpBB's perspective, and phpBB isn't doing anything G-Suite or non-G-Suite specific. The "Allow users to manage their access to less secure apps" aspect is in regard to how SMTP must be enabled for the Google-managed email account itself; regardless of whether you're enabling it with an intention to use phpBB with SMTP, or any other SMTP-enabled application.

If you are able to connect with Google's SMTP servers from the hosting account where you are running phpBB, note that you likely still need to apply this updated functions_messenger.php first. Because I believe it's been previously confirmed that Google's SMTP servers are among the many SMTP servers which no longer allow TLS 1.0 or lower to be negotiated. This issue will be addressed in the future phpBB 3.2.8 and later; but for current phpBB 3.2.7 installation you would have to apply the updated functions_messenger.php yourself.

Post Reply

Return to “[3.2.x] Support Forum”