(Quick Reference)

1 Introduction - Reference Documentation

Authors: Grails Plugin Collective

Version: 1.0.8-SNAPSHOT

1 Introduction

The Grails mail plugin provides a convenient DSL for sending email. It supports plain text, html, attachments, inline resources and i18n among other features.

Mail can be sent using the mailService via the sendMail method. Here is an example…

mailService.sendMail {
   to "fred@gmail.com", "ginger@gmail.com"
   from "john@gmail.com"
   cc "marge@gmail.com", "ed@gmail.com"
   bcc "joe@gmail.com"
   subject "Hello John"
   text "this is some text"
}

Here we are sending a plain text email with no attachments to the given addresses.

The sendMail method is injected into all controllers to simplify access:

sendMail {
   to "fred@g2one.com"
   subject "Hello Fred"
   text "How are you?"
}