Send Email In Grails

Dependency : compile "org.grails.plugins:mail:1.0.7"


For User Guide

you can get more details with follow this link user guide

how to Use ?

define the mailService in the groovy controller like that:
mailService.sendMail {
   to "test@gamil.com","test1@g2one.com"
   from "john@g2one.com"
   cc "test2@g2one.com", "test3@g2one.com"
   bcc "test4@g2one.com"
   subject "Hello Harnarayan"
   body 'this is some text'
}

Configuration

By default the plugin assumes an unsecured mail server configured at localhost on port 25. However you can change this via the grails-app/Config.groovy file. For example here is how you would configure the default sender to send with a Gmail account:
grails {
   mail {
     host = "smtp.gmail.com"
     port = 587
     username = "youracount@gmail.com"
     password = "yourpassword"
     props = ["mail.smtp.starttls.enable":"true", 
                  "mail.smtp.port":"587"]
   }
}
for Yahoo !!! Server
  grails {
   mail {
      host = "smtp.correo.yahoo.es"
      port = 465
      username = "myuser"
      password = "mypassword"
      props = [ "mail.smtp.auth":"true",
                       "mail.smtp.socketFactory.port":"465",
                       "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
                       "mail.smtp.socketFactory.fallback":"false"  ]
   }
}