1
我試圖用Grails Async Mail API「無法識別的SSL消息,明文連接」時發送郵件使用Grails異步郵件API
當我用下面的配置嘗試使用Gmail來發送郵件:
在 配置grails {
mail {
host = "smtp.gmail.com"
port = 465
username = "[email protected]"
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"]
}
}
.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?
請給我一些暗示,我在做什麼錯在上述情況下。
@Williams ...它爲我工作,謝謝。 – mark