gpt4 book ai didi

email - 在 Grails 邮件中获取 MailSendException

转载 作者:行者123 更新时间:2023-12-02 02:39:09 26 4
gpt4 key购买 nike

我收到以下错误:

错误

org.springframework.mail.MailSendException: Failed messages:javax.mail.MessagingException: can't determine local email address; message exceptions (1)     are:
Failed message 1: javax.mail.MessagingException: can't determine local email address

配置

grails.mail.host = "xx.xx.com"
grails.mail.port = 25
grails.mail.from = "xx@xx.com"
grails.mail.username = "xx@xx.com"
grails.mail.password = "xxx"
grails.mail.props = ["mail.smtp.auth": "true",
"mail.smtp.socketFactory.port": "25",
"mail.smtp.socketFactory.fallback": "false"]

代码

try {
sendMail {
to "${params.emailTo}"
subject "${params.emailSubject}"
body "${params.emailMessage}"
}
}
catch (Exception e) {
println e
}

最佳答案

解决方案* **也改变了这个并且它起作用了

 sendMail {
to "${params.emailTo}"
from "xx@xx.com"
subject "${params.emailSubject}"
body "${params.emailMessage}"
}

关于email - 在 Grails 邮件中获取 MailSendException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6385216/

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