org.appfuse.service
Class MailEngine

java.lang.Object
  extended by org.appfuse.service.MailEngine

public class MailEngine
extends Object

Class for sending e-mail messages based on Velocity templates or with attachments.

View Source

Author:
Matt Raible

Field Summary
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
MailEngine()
           
 
Method Summary
 void send(SimpleMailMessage msg)
          Send a simple message with pre-populated values.
 void sendMessage(SimpleMailMessage msg, String templateName, Map model)
          Send a simple message based on a Velocity template.
 void sendMessage(String[] emailAddresses, ClassPathResource resource, String bodyText, String subject, String attachmentName)
          Convenience method for sending messages with attachments.
 void setMailSender(MailSender mailSender)
           
 void setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Constructor Detail

MailEngine

public MailEngine()
Method Detail

setMailSender

public void setMailSender(MailSender mailSender)

setVelocityEngine

public void setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine)

sendMessage

public void sendMessage(SimpleMailMessage msg,
                        String templateName,
                        Map model)
Send a simple message based on a Velocity template.

Parameters:
msg -
templateName -
model -

send

public void send(SimpleMailMessage msg)
Send a simple message with pre-populated values.

Parameters:
msg -

sendMessage

public void sendMessage(String[] emailAddresses,
                        ClassPathResource resource,
                        String bodyText,
                        String subject,
                        String attachmentName)
                 throws MessagingException
Convenience method for sending messages with attachments.

Parameters:
emailAddresses -
resource -
bodyText -
subject -
attachmentName -
Throws:
MessagingException


Copyright � 2002-2006