How to use GMAIL as SMTP server (the right way)

Arkage
New Contributor

Hi everybody,

would like to share this short guide to help other users out using gmail as official server to send email.
it works in both cases with @gmail.com domain and google managed one @my_domain.tld

CONFIGURATION

Server and Port: smtp.gmail.com : 587
Encryption: TLSv1.2
Connection timeout: 30 sec
Sender Display name: JAMF Software Server
Sender email address: ______@XXXX //your domain, gmail o gmail-managed
Username: _______@XXXX //your domain, gmail o gmail-managed

check AUTHENTICATED CONNECTION.
use same email and password we used for the SMTP account.

IMPORTANT NOTE:
Less secure app option should be turned at ACCOUNT LEVEL, not at organization one. as a console admnistrator I wasted hours debugging this issue and realized just now that the option must be on at account level, not at organization one.

Less secure apps & your Google Account

hope this will help!

brgds.
Arkage.

15 REPLIES 15

sdecook
Contributor

I ran into this recently as well. Thanks for the write up.

One thing to note is that Google allows 2000 messages a day using this method. Depending on how many notifications you have and how big your organization is it could hit that. Google SMTP Settings

joeharden
New Contributor II

until gmail disables that "feature"
I prefer to use the smtp-relay.gmail.com service for stuff like this, as it has a 10,000/day limit but can't get a lock on all the possible outbound IPs jamfcloud uses.

macbrun
New Contributor III

Thank you @Arkage! This worked perfectly.

TrafficJam
New Contributor

Thanks Arkage. Once I enabled less secure option on my gmail account, the test email works!

edgar
New Contributor II

Thanks @Arkage , this helped me set it up quick.

justscrewitinc
New Contributor

This is still not allowing to send. Thank you and i will update on our solution.

user-NhRawIIVsG
New Contributor

You can (and should) do this without enabling less secure apps. Create an app-specific password for the user and use that instead: https://myaccount.google.com/apppasswords

Accounts that have 2FA turned on are not allowed to enable less secure apps anyway.

jmmoes
New Contributor

Thanks a million, Arkage, you saved my day!

Morningside
Contributor II

I configured my smtp server as suggested in this post but it fails the test each time. Any tips on troubleshooting?

atomczynski
Valued Contributor

@Morningside

Try the following settings

Port: 465
Encryption Type: SSL
Connection Timeout: 5 Seconds

Requires Authentication is checked.

You are using an actual account username and password, are you able to sign in to the account itself (not using Jamf)?

RJ52
New Contributor III

Just a heads up, this option has been depreciated and you're no longer able to enable the less secure option.

jabberwalker
New Contributor

So without being able to enable less secure apps is there no way to have Gmail as an SMTP server in Jamf?

jabberwalker
New Contributor

Thank you! This was also my fix I did skip the first half with setting up LSA. 

kevinv
New Contributor III

We followed the HCSOnline guide without issue. Just noticed it broke last week. No changes to the service account being used. Going to try deleting and re-creating the app password to see if that resolves it. Curious if anyone can speculate why this may have happened.