gpt4 book ai didi

grails - 使用grails异步邮件api发送邮件期间“Unrecognized SSL message, plaintext connection”

转载 作者:行者123 更新时间:2023-12-02 14:32:46 24 4
gpt4 key购买 nike

我正在尝试使用Grails Async Mail API发送邮件

当我尝试使用以下配置访问Gmail时:

grails {
mail {
host = "smtp.gmail.com"
port = 465
username = "xxxx@gmail.com"
password = "xxxx"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
}
}

config.groovy 中,我能够发送邮件。当我如下更改特定邮件服务器的上述配置时:
grails {
mail {
host = "xxx"
port = 25
username = "xxx"
props = ["mail.smtp.auth":"false",
"mail.smtp.socketFactory.port":"25",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"true",
"mail.smtp.starttls.enable": "false",
"mail.smtp.starttls.required": "false"]
}
}

我得到以下错误:
javax.mail.MessagingException: Could not connect to SMTP host: xxx, port: 25;
nested exception is:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

请提供一些提示,以上情况我做错了什么。

最佳答案

您可以尝试做简单的跟踪,它应该对您有用

grails {
mail {
host = "xxx"
port = 25
username = "xxx"
props = ["mail.smtp.auth":"false",
"mail.smtp.socketFactory.port":"25",
"mail.smtp.starttls.enable": "true"]
}
}

关于grails - 使用grails异步邮件api发送邮件期间“Unrecognized SSL message, plaintext connection”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22857176/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com