'Firebase Trigger email and SMTP connection URI using GMAIL
I am trying to set up TRIGGER EMAIL to send emails through my GMAIL account. My problem is definitely in the SMTP connection URI because the same configuration works fine with the SENDGRID SMTP connection URI.
So I think the problem is specifically with GMAIL.
After enabling access to third-party applications in GMAIL, I have tried:
- smtps://[email protected]:[email protected]:465
- smtps://[email protected]:[email protected]
- smtp://[email protected]:[email protected]:25
- smtp://[email protected]:[email protected]
and the same variants with %40 instead of @
I always get errors like: Error: Invalid login:
Are you managed to get GMAIL to work with FIREBASE TRIGGER MAIL?
Sorry for my english
Solution 1:[1]
The error message is quite explicit and seem that has to do with User's Authentication.
- Enable Less secure apps & your Google Account for that user.
You can enabled it Here, scroll to the bottom and you will is it. IMPORTANT NOTE: Most of the time may take up to 48 hours!
If you have 2 Step verification Then DON'T enable the Less secure Apps (it won't work) and create Create and use app passwords The password can be Used for 1 App only.
- With the affected User, go to UnlockCaptcha, make sure that if the ONLY user logged in the session an no other Google account is, so unlockcaptcha.
If still not work try:
smtps://[email protected]:[email protected]:587
Allow access to your Google Account: accounts.google.com/b/0/DisplayUnlockCaptcha
Solution 2:[2]
I believe you need to have Google Workspace set up
Then try this: smtp://[email protected]:[email protected]:587
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Federico Baù |
Solution 2 | Theo Taylor |