How to set the content type with Grails mail plugin?
The Grails mail开发者_高级运维 plugin documentation shows only how to set the content type with GSP templates:
<%@ page contentType="text/html"%>
But I don't use GSP (and will not!) and produce a String with FreeMarker. Is there a way to set the content type without using GSP?
If you use the html statement in the sendMail method the plugin will set the content type for you. The sendMail command can be used without requiring a gsp template.
mailService.sendMail {
to "recipient@recipient.com"
from "someone@place.com"
subject "Email without gsp"
html "some markup"
}
精彩评论