|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.ramapuram.thomas.service.MailEngine
public class MailEngine
Class for sending e-mail messages based on Velocity templates or with attachments.
| Constructor Summary | |
|---|---|
MailEngine()
|
|
| Method Summary | |
|---|---|
org.springframework.mail.MailSender |
getMailSender()
|
void |
send(org.springframework.mail.SimpleMailMessage msg)
Send a simple message with pre-populated values. |
void |
sendMessage(org.springframework.mail.SimpleMailMessage msg,
java.lang.String templateName,
java.util.Map model)
Send a simple message based on a Velocity template. |
void |
sendMessage(java.lang.String[] recipients,
java.lang.String sender,
org.springframework.core.io.ClassPathResource resource,
java.lang.String bodyText,
java.lang.String subject,
java.lang.String attachmentName)
Convenience method for sending messages with attachments. |
void |
setFrom(java.lang.String from)
|
void |
setMailSender(org.springframework.mail.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 |
| Constructor Detail |
|---|
public MailEngine()
| Method Detail |
|---|
public void setMailSender(org.springframework.mail.MailSender mailSender)
public org.springframework.mail.MailSender getMailSender()
public void setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine)
public void setFrom(java.lang.String from)
public void sendMessage(org.springframework.mail.SimpleMailMessage msg,
java.lang.String templateName,
java.util.Map model)
msg - the message to populatetemplateName - the Velocity template to use (relative to classpath)model - a map containing key/value pairs
public void send(org.springframework.mail.SimpleMailMessage msg)
throws org.springframework.mail.MailException
msg - the message to send
org.springframework.mail.MailException - when SMTP server is down
public void sendMessage(java.lang.String[] recipients,
java.lang.String sender,
org.springframework.core.io.ClassPathResource resource,
java.lang.String bodyText,
java.lang.String subject,
java.lang.String attachmentName)
throws javax.mail.MessagingException
recipients - array of e-mail addressessender - e-mail address of senderresource - attachment from classpathbodyText - text in e-mailsubject - subject of e-mailattachmentName - name for attachment
javax.mail.MessagingException - thrown when can't communicate with SMTP server
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||