开发者

How to set the content type with Grails mail plugin?

开发者 https://www.devze.com 2023-02-09 18:37 出处:网络
The Grails mail开发者_高级运维 plugin documentation shows only how to set the content type with GSP templates:

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"
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消