Gmail SMTP does not work
Gmail SMTP does not work
Description
Cannot use Gmail (smtp.gmail.com), test emails fail with generic non-informative message, event if Debug is enabled
Affects versions
1.40.2
Steps to reproduce
Steps to reproduce the behavior:
- Go to Tenant Settings, Email Section
- Enter any valid Gmail smtp configuration that works fine with other SMTP clients like Thunderbird
- Try to send test email
- See error "Unable to send email via JavaMail / Prime Messaging Exception"
Expected behavior
SMTP configuration must work for such a major service as Google
Platform
(Please complete the following information)
- Device: Ubuntu 12.12 server with FusionAuth installation at backend / Desktop at client side
- OS: Ubuntu 12.12 server at backend / Windows 11 Home at client side
- Chrome Version 106.0.5249.103 (Official Build) (64-bit) at client side
- psql (PostgreSQL) 12.12 (Ubuntu 12.12-0ubuntu0.20.04.1) at server side
Community guidelines
All issues filed in this repository must abide by the FusionAuth community guidelines.
Additional context
Add any other context about the problem here.
Thanks for filing this. I was able to replicate. No messages in the event log.
Here's a link for the gmail SMTP setup: https://support.google.com/mail/answer/7126229?hl=en#zippy=%2Cstep-change-smtp-other-settings-in-your-email-client
Some consumer oriented SMTP servers have a lot of restrictions that may be out of our control.
Can you replicate the results with something like SWAKS to ensure it is something specific to FusionAuth? https://jetmore.org/john/code/swaks/
Likely related to this fix...based on my past experience this was a Gmail setup configuration issue (but will leave open the possibility that something else is at play here or that possibly our error handler could relay more info).
https://fusionauth.io/community/forum/topic/1112/smtp-server-gmail-setup-error/3?_=1666277007403
@mooreds , @jobannon
Issue reporter here. Found a way to solve it.
You really need to use 16-char app passwords with Google SMTP, as it is suggested here https://support.google.com/accounts/answer/185833, thanks @jobannon
It works fine then. Maybe it makes sense to add a simple checking to FusionAuth web page, like, if STMP server is "smtp.gmail.com", show alert("Hey, normal passwords do not work with Google, use app password")
Thank you @dmitri777 for sharing!
This is probably too implementation specific for our docs or product, but I added a forum post: https://fusionauth.io/community/forum/topic/2233/having-trouble-using-gmail-smtp-for-email-sending