-
Notifications
You must be signed in to change notification settings - Fork 357
Issues using Gmail SMTP
When using your Gmail SMTP credentials, you may get an error like:
Error Sending: Email failed to send. Error: authorization.failed
Obviously this could happen if your credentials are wrong, so be sure to double check them.
Try using tls: true
instead of ssl: true
in your email config.
Another reason this could happen is because you have 2-factor/2-step authorization setup. In this case you need to create an app specific password.
- Generate a app specific password here for email here: https://security.google.com/settings/security/apppasswords
- Use this password in your
./config.js
(remember to include the spaces between each 4 char set)
Gmail may not allow access to non-Google apps citing security reasons. Change settings in Gmail's My Account->Sign-in & Security https://myaccount.google.com/security?utm_source=OGB&pli=1#connectedapps
- Switch to "Allow less secure apps: ON" which is Off by default
per: https://stackoverflow.com/questions/25693280/nodemailer-with-gmail-service-not-working-on-heroku
Google blocked your sign in to use the mailing features due to unknown device (location).
A few step to verify this:
Start your server locally and sends the email. Check your account alerts for unknown sign in.
This can be temporally resolved by: https://accounts.google.com/DisplayUnlockCaptcha
More permanent resolution would be to change your password to a stronger level:
upper case letter + lower case letter + special symbols + numbers
We hope this was helpful. If you have questions or think this page should be expanded please contribute by opening an issue or updating this page.