【发布时间】:2014-12-31 09:32:04
【问题描述】:
我在我的网络应用程序中使用我的 Gmail 帐户和 smtp.gmail.com 来测试和发送电子邮件。当我的 Gmail 帐户启用两因素身份验证时,它无法发送电子邮件,但是当我将其关闭时,Web 应用程序会成功发送电子邮件。欣赏任何形式的建议。
【问题讨论】:
标签: smtp gmail smtpclient two-factor-authentication
我在我的网络应用程序中使用我的 Gmail 帐户和 smtp.gmail.com 来测试和发送电子邮件。当我的 Gmail 帐户启用两因素身份验证时,它无法发送电子邮件,但是当我将其关闭时,Web 应用程序会成功发送电子邮件。欣赏任何形式的建议。
【问题讨论】:
标签: smtp gmail smtpclient two-factor-authentication
如果您因为在 Mac OSX 上使用 ARQ 备份应用程序遇到问题而来到这里,我发现以下设置对我有用:
SMTP hostname: smtp.gmail.com
SMTP Port: 587
Click: Enable SSL (STARTTLS)
Authentication Type: Password (SASL PLAIN)
User Name: <full Gmail email address>
Password: <Google-generated app password>
Google 生成的应用密码是按照 @stoyan-dimov 在上面的回答中建议的那样生成的,使用以下 URL:
https://security.google.com/settings/security/apppasswords
选择生成“邮件”密码,并将设备设置为“自定义”(我称我的“ARQ”。)
警告:您必须在您的 Google 帐户上启用双重身份验证才能访问上述网址。
【讨论】:
在您的 Gmail 安全设置中创建自定义应用。
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.
将令牌作为密码与您的完整 Gmail 帐户结合使用,不需要两因素身份验证。
注意:第 2 步中的链接仅在您启用了 2-factor-authentication 时才有效。
【讨论】: