gmail 的 SMTP 配置?

SMTP config for gmail?

我正在尝试在 TeamCity 服务器中配置电子邮件通知。

我阅读了 this and this 文档,并尝试设置配置

这是我尝试过的 2 个配置以及当我按下下面的 Test connection 按钮时收到的相应错误:

配置 1

SMTP host: smtp.gmail.com
SMTP port: 465
Send email messages from: foobar@gmail.com
SMTP login: foobar@gmail.com
SMTP password: •••••••••
Secure connection: SSL

错误:

javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465; nested exception is: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

配置 2

SMTP host: smtp.gmail.com
SMTP port: 587
Send email messages from: foobar@gmail.com
SMTP login: foobar@gmail.com
SMTP password: •••••••••
Secure connection: StartTSL

错误:

javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

这里出了什么问题?

我 运行 遇到了同样的问题,在我的情况下禁用 AVAST 足以解决问题。

希望对您有所帮助!

我禁用了防病毒软件,它起作用了:)