|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.kew.mail.Mailer
public class Mailer
Maintains a Java Mail session and can be used for sending emails.
Nested Class Summary | |
---|---|
private static class |
Mailer.SimpleAuthenticator
SimpleAuthenticator is used to do simple authentication when the SMTP server requires it. |
Field Summary | |
---|---|
private javax.mail.Authenticator |
authenticator
|
private Properties |
configProperties
|
private javax.mail.Session |
currentSession
|
protected org.apache.log4j.Logger |
LOG
|
Constructor Summary | |
---|---|
Mailer(Properties configProperties)
|
|
Mailer(Properties configProperties,
javax.mail.Authenticator authenticator)
Create a AuthenticatedMailer with the default values for authenticated use of mail-relay.iu.edu. |
|
Mailer(Properties configProperties,
String username,
String password)
|
Method Summary | |
---|---|
javax.mail.Authenticator |
getAuthenticator()
|
Properties |
getConfig()
|
javax.mail.Session |
getCurrentSession()
This allows direct access to the Mail Session. |
private void |
prepareHtmlMessage(String messageText,
javax.mail.Message message)
|
void |
sendMessage(String sender,
javax.mail.Address[] recipients,
String subject,
String messageBody,
javax.mail.Address[] ccRecipients,
javax.mail.Address[] bccRecipients,
boolean htmlMessage)
Sends an email to the given recipients. |
void |
sendMessage(String sender,
String recipient,
String subject,
String messageBody,
boolean htmlMessage)
Send a message to the designated recipient with the specified subject and message. |
void |
setConfig(Properties configProperties)
A method to configure the Mailer properties. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.log4j.Logger LOG
private Properties configProperties
private javax.mail.Authenticator authenticator
private javax.mail.Session currentSession
Constructor Detail |
---|
public Mailer(Properties configProperties, javax.mail.Authenticator authenticator)
senderAddress
- return address for the mail being sentkbPrincipleName
- kerberos principle name used to authenticate to mail-relaykbPrinciplePassword
- kerberos principle password used to authenticate to mail-relaypublic Mailer(Properties configProperties)
public Mailer(Properties configProperties, String username, String password)
Method Detail |
---|
public void setConfig(Properties configProperties)
mailConfigProperties
- Proeprties object containing configuration informationpublic void sendMessage(String sender, javax.mail.Address[] recipients, String subject, String messageBody, javax.mail.Address[] ccRecipients, javax.mail.Address[] bccRecipients, boolean htmlMessage) throws javax.mail.internet.AddressException, javax.mail.MessagingException
recipients
- list of addresses to which the message is sentsubject
- subject of the messagemessageBody
- body of the messageccRecipients
- list of addresses which are to be cc'd on the messagebccRecipients
- list of addresses which are to be bcc'd on the message
javax.mail.internet.AddressException
javax.mail.MessagingException
public void sendMessage(String sender, String recipient, String subject, String messageBody, boolean htmlMessage) throws javax.mail.internet.AddressException, javax.mail.MessagingException
recipient
- the email address to which the message is sentsubject
- subject for the messagemessageBody
- body of the message to to be sentccRecipient
- email address of a cc recipient
javax.mail.internet.AddressException
javax.mail.MessagingException
public Properties getConfig()
public javax.mail.Authenticator getAuthenticator()
public javax.mail.Session getCurrentSession() throws javax.mail.NoSuchProviderException
javax.mail.NoSuchProviderException
private void prepareHtmlMessage(String messageText, javax.mail.Message message) throws javax.mail.MessagingException
javax.mail.MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |