public class MailEngine extends Object
| Constructor and Description |
|---|
MailEngine() |
| Modifier and Type | Method and Description |
|---|---|
void |
send(org.springframework.mail.SimpleMailMessage msg)
Send a simple message with pre-populated values.
|
void |
sendMessage(org.springframework.mail.SimpleMailMessage msg,
String templateName,
Map model)
Send a simple message based on a Velocity template.
|
void |
sendMessage(String[] recipients,
String sender,
org.springframework.core.io.ClassPathResource resource,
String bodyText,
String subject,
String attachmentName)
Convenience method for sending messages with attachments.
|
void |
setMailSender(org.springframework.mail.MailSender mailSender) |
void |
setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine) |
public void setMailSender(org.springframework.mail.MailSender mailSender)
public void setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine)
public void sendMessage(org.springframework.mail.SimpleMailMessage msg,
String templateName,
Map model)
msg - the message to populatetemplateName - the Velocity template to use (relative to classpath)model - a map containing key/value pairspublic void send(org.springframework.mail.SimpleMailMessage msg)
msg - the message to sendpublic void sendMessage(String[] recipients, String sender, org.springframework.core.io.ClassPathResource resource, String bodyText, String subject, 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 attachmentjavax.mail.MessagingException - thrown when can't communicate with SMTP serverCopyright © 2015. All rights reserved.