java - gmail 的 SMTP 配置?

标签 java email ssl smtp gmail

<分区>

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

我读了thisthis文档,并尝试设置配置

这是我尝试过的 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 足以解决问题。

https://stackoverflow.com/a/27389691/1259763

希望对您有所帮助!

关于java - gmail 的 SMTP 配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40085336/

相关文章:

java - 使用 Java 和递归进行二叉树的级别顺序遍历

ssl - Coverity 提交缺陷错误,SSL 请求失败 : Server's SSL preference is "preferred"

python - Python 中的 JSON GET 和 POST

windows - 我可以使用 SChannel 获取 SOCKET 吗?

java - switch 语句不显示正确答案

java - 如何反序列化对象持久化类在类中具有较少的属性而新类具有额外的属性

java - 从 OSGI bundle 调用 JDBC 和 UCP 连接

java - 如何使用 javamail 将我网站的联系表单链接到我的邮件

python - 从 Outlook 电子邮件中提取嵌入图像

ios - 如何将 gif 添加到 iPhone 邮件中的附件?