Gmail SMTP 访问 5.5.1 需要身份验证。来自自定义域

Gmail SMTP Access 5.5.1 Authentication Required. From Custom Domain

我正在尝试以标准方式通过 smtp.gmail.com 发送电子邮件,但出现标准错误,但对于某些 非标准原因.

具体来说,我在发送邮件时收到此错误:System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.

这个 link 的答案对我没有帮助:The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required?

我怀疑如果您尝试从自定义域执行此操作,还需要其他步骤.

我创建了一个一次性的标准 Gmail 帐户来测试我的代码,一切都在那里完美运行。

所以我的代码以及我配置通用 Gamil 帐户的能力都运行良好。

但是当我使用一个在其他方面相同的 GSuite 电子邮件地址时,在自定义域 (system@clientdomain.co.uk) 上设置然后没有任何效果 :( 我已经尝试了所有排列,with/without LessSecureApps,使用主用户密码/使用第 3 方应用程序密码等。没有任何效果。

我只能假设自定义域或它是 GSuite 帐户这一事实正在破坏它。

现在怎么办?

所以显然我需要等待更长的时间,或者更改设置 更难!!

有同事路过,问是什么问题,我演示了一下,包括过一遍,重新设置,这次成功了。我 80% 确定它们是相同的设置,但也许不是?