public class SendMailJob
extends java.lang.Object
implements org.quartz.Job
A Job which sends an e-mail with the configured content to the configured recipient. Arbitrary mail.smtp.xxx settings can be added to job data and they will be passed along the mail session
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SendMailJob.MailInfo |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROP_CC_RECIPIENT
The e-mail address to cc the mail to.
|
static java.lang.String |
PROP_CONTENT_TYPE
The message content type.
|
static java.lang.String |
PROP_MESSAGE
The e-mail message body.
|
static java.lang.String |
PROP_PASSWORD
Password for authenticated session.
|
static java.lang.String |
PROP_RECIPIENT
The e-mail address to send the mail to.
|
static java.lang.String |
PROP_REPLY_TO
The e-mail address the message should say to reply to.
|
static java.lang.String |
PROP_SENDER
The e-mail address to claim the mail is from.
|
static java.lang.String |
PROP_SMTP_HOST
The host name of the smtp server.
|
static java.lang.String |
PROP_SUBJECT
The subject to place on the e-mail.
|
static java.lang.String |
PROP_USERNAME
Username for authenticated session.
|
| Constructor and Description |
|---|
SendMailJob() |
| Modifier and Type | Method and Description |
|---|---|
protected SendMailJob.MailInfo |
createMailInfo() |
void |
execute(org.quartz.JobExecutionContext context) |
protected org.slf4j.Logger |
getLog() |
protected javax.mail.Session |
getMailSession(SendMailJob.MailInfo mailInfo) |
protected java.lang.String |
getOptionalParm(org.quartz.JobDataMap data,
java.lang.String property) |
protected java.lang.String |
getRequiredParm(org.quartz.JobDataMap data,
java.lang.String property,
java.lang.String constantName) |
protected SendMailJob.MailInfo |
populateMailInfo(org.quartz.JobDataMap data,
SendMailJob.MailInfo mailInfo) |
protected javax.mail.internet.MimeMessage |
prepareMimeMessage(SendMailJob.MailInfo mailInfo) |
protected void |
setMimeMessageContent(javax.mail.internet.MimeMessage mimeMessage,
SendMailJob.MailInfo mailInfo) |
public static final java.lang.String PROP_SMTP_HOST
public static final java.lang.String PROP_RECIPIENT
public static final java.lang.String PROP_CC_RECIPIENT
public static final java.lang.String PROP_SENDER
public static final java.lang.String PROP_REPLY_TO
public static final java.lang.String PROP_SUBJECT
public static final java.lang.String PROP_MESSAGE
public static final java.lang.String PROP_CONTENT_TYPE
public static final java.lang.String PROP_USERNAME
public static final java.lang.String PROP_PASSWORD
public void execute(org.quartz.JobExecutionContext context)
throws org.quartz.JobExecutionException
execute in interface org.quartz.Joborg.quartz.JobExecutionExceptionJob.execute(org.quartz.JobExecutionContext)protected org.slf4j.Logger getLog()
protected javax.mail.internet.MimeMessage prepareMimeMessage(SendMailJob.MailInfo mailInfo) throws javax.mail.MessagingException
javax.mail.MessagingExceptionprotected void setMimeMessageContent(javax.mail.internet.MimeMessage mimeMessage,
SendMailJob.MailInfo mailInfo)
throws javax.mail.MessagingException
javax.mail.MessagingExceptionprotected javax.mail.Session getMailSession(SendMailJob.MailInfo mailInfo) throws javax.mail.MessagingException
javax.mail.MessagingExceptionprotected SendMailJob.MailInfo createMailInfo()
protected SendMailJob.MailInfo populateMailInfo(org.quartz.JobDataMap data, SendMailJob.MailInfo mailInfo)
protected java.lang.String getRequiredParm(org.quartz.JobDataMap data,
java.lang.String property,
java.lang.String constantName)
protected java.lang.String getOptionalParm(org.quartz.JobDataMap data,
java.lang.String property)