gpt4 book ai didi

java - Grails邮件插件Office365

转载 作者:行者123 更新时间:2023-12-02 15:48:35 25 4
gpt4 key购买 nike

我有一个使用以下配置发送邮件的代码。
它适用于开发(Windows,Java 1.7,Grails 2.3.7),但不适用于生产环境(ubuntu,tomcat7,jdk 1.7)

任何人都知道为什么这对开发人员有效,但对产品无效吗?有任何解决这个问题的方法吗?

旁注:该代码曾经可以工作,但是突然停止工作。不知道发生了什么变化。

配置:

grails {
mail {
host = "Outlook.office365.com"
port = 587
username = "username here"
password = "password here"
props = ["mail.smtp.starttls.enable":"true" ,
"mail.smtp.port":"587",
// "mail.debug":"true"
]
}
}

Edit1:注释中的要点,忘记包含错误。希望尽快看到一些建议和评论! :)
Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: Outlook.office365.com, 587; timeout -1; nested exception is: java.net.UnknownHostException: Outlook.office365.com. Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: Outlook.office365.com, 587; timeout -1; nested exception is: java.net.UnknownHostException: Outlook.office365.com

最佳答案

好的,经过一段时间的努力,我发现该死的dns发生了变化.....

更改dns并重新启动后,它又恢复了正常。

感谢您的建议和后续的问题。

(尝试使用telnet毫无响应。检查dns并尝试ping毫无响应。甚至无法ping stackoverflow。已更改为其他dns。重新启动。)

关于java - Grails邮件插件Office365,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43165842/

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