Java 如何使用Grails邮件插件设置内容类型?

Java 如何使用Grails邮件插件设置内容类型?,java,email,grails,content-type,grails-plugin,Java,Email,Grails,Content Type,Grails Plugin,仅显示如何使用GSP模板设置内容类型: <%@ page contentType="text/html"%> 但我不使用GSP(也不会!),而是使用FreeMarker生成字符串。有没有不使用GSP设置内容类型的方法?如果在sendMail方法中使用html语句,插件将为您设置内容类型。sendMail命令可以在不需要gsp模板的情况下使用 mailService.sendMail { to "recipient@recipient.com"

仅显示如何使用GSP模板设置内容类型:

<%@ page contentType="text/html"%>


但我不使用GSP(也不会!),而是使用FreeMarker生成字符串。有没有不使用GSP设置内容类型的方法?

如果在sendMail方法中使用html语句,插件将为您设置内容类型。sendMail命令可以在不需要gsp模板的情况下使用

mailService.sendMail {
            to "recipient@recipient.com"
            from "someone@place.com"
            subject "Email without gsp"
            html "some markup"
        }

如果您在sendMail方法中使用html语句,插件将为您设置内容类型。sendMail命令可以在不需要gsp模板的情况下使用

mailService.sendMail {
            to "recipient@recipient.com"
            from "someone@place.com"
            subject "Email without gsp"
            html "some markup"
        }