1
的Grails mail plugin documentation只显示了如何使用GSP模板设置的内容类型:如何使用Grails邮件插件设置内容类型?
<%@ page contentType="text/html"%>
但我不使用GSP(而不会!),并产生与FreeMarker的字符串。有没有办法在不使用GSP的情况下设置内容类型?
的Grails mail plugin documentation只显示了如何使用GSP模板设置的内容类型:如何使用Grails邮件插件设置内容类型?
<%@ page contentType="text/html"%>
但我不使用GSP(而不会!),并产生与FreeMarker的字符串。有没有办法在不使用GSP的情况下设置内容类型?
如果您在sendMail方法中使用html语句,插件将为您设置内容类型。 sendMail命令可以在不需要gsp模板的情况下使用。
mailService.sendMail {
to "[email protected]"
from "[email protected]"
subject "Email without gsp"
html "some markup"
}