Novamail Plugin

  • Tags: mail, javamail, email
  • Latest: 0.3.5
  • Last Updated: 06 June 2014
  • Grails version: 2.0 > *
1 vote
Dependency:
compile ":novamail:0.3.5"

 Documentation  Source  Issues

Summary

The Novamail plug-in provides e-mail sending and retrieving capabilities to a Grails application. It is also capable of sending emails asynchronously by using a scheduled Job.

Installation

To install the novamail plug-in just run the following command
grails install-plugin novamail

or add the following to your buildConfig.groovy file (recommended)

compile ":novamail:0.2.2"

Description

The Novamail plug-in provides e-mail sending and retrieving capabilities to a Grails application. It is also capable of sending emails asynchronously by using a scheduled Job.

Usage

The novamail plug-in provides a MessagingService that can be used anywhere in your Grails application. The MessagingService provides several methods to enable you send emails depending of your requirements.

One of the methods provided by

messagingService
is the
sendEmail()
method.

Please note that

sendEmail()
takes the following parameters :
String hostname, String username, String password, String from, String to, String subject, String body,boolean html, List<File> attachments
.

An example usage of

sendEmail()
can be seen below:

Inject messagingService into your class

def messagingService

Where ......

hostName: name of the host eg Gmail, Hotmail, Yahoo

username: email username eg John@example.com

password: email password eg *

from: eg john@gmail.com

to: eg doe@gmail.com

subject: "Your email subject"

body: "The body of your message"

html: 'true' or 'false'

attachments: A list of File object (optional)

An example usage can be seen below.

Class yourControllerOrService{
	def messagingService

def yourMethod(){ messagingService.sendEmail( "Gmail", "john@gmail.com", "password", "john@gmail.com", "recipient@gmail.com", "email subject", "email body", true, null )

} }