Email 如何覆盖';从';Grails邮件插件中的参数
安装grails mail插件后,当我尝试使用ff代码时:Email 如何覆盖';从';Grails邮件插件中的参数,email,grails,configuration,groovy,grails-plugin,Email,Grails,Configuration,Groovy,Grails Plugin,安装grails mail插件后,当我尝试使用ff代码时: mailService.sendMail { to recipients.toArray() from "${userEmail}" subject "${url?.article?.title}" html g.render(template:"/promote/email_template", model: [newsUrl : newShortUrl, news : url?.article, comment: s
mailService.sendMail {
to recipients.toArray()
from "${userEmail}"
subject "${url?.article?.title}"
html g.render(template:"/promote/email_template", model: [newsUrl : newShortUrl, news : url?.article, comment: status, user : user, rootUrl : rootUrl])
}
但是from
参数返回的不是userEmail的数据,而是配置文件中使用的电子邮件的数据。是否有方法覆盖此数据并使用其他数据(用户电子邮件)
我假设因为可以使用From参数,所以我可以用当前用户正在使用的任何电子邮件设置它。我成功地使用了
From
方法,但我也省略了grails.mail.default.From
配置。医生说它应该像你期望的那样工作。您的发送SMTP服务器是否偶然将其覆盖回您的登录