Sending email fails when two factor authentication

2019-01-16 08:19发布

I am using my Gmail account and smtp.gmail.com inside my web application to test and send email. when two factor authentication is ON for my Gmail account, it fails to send the email, however when I turn off two factor authentication for my Gmail account, the web application sends email successfully. Appreciate any kind of advice.

1条回答
劳资没心,怎么记你
2楼-- · 2019-01-16 08:39

Create a custom app in you Gmail security settings.

1. Log-in into Gmail with your account
2. Navigate to https://security.google.com/settings/security/apppasswords
3. In 'select app' choose 'custom', give it an arbitrary name and press generate
4. It will give you 16 chars token.

Use the token as password in combination with your full Gmail account and two factor authentication will not be required.

查看更多
登录 后发表回答