|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.utils.JavaMailer
public class JavaMailer
Sends an email message using the Java Mail API
| Nested Class Summary | |
|---|---|
static class |
JavaMailer.LoggingByteArrayOutputStream
|
static class |
JavaMailer.LoggingTransportListener
|
| Constructor Summary | |
|---|---|
JavaMailer()
Default constructor. |
|
JavaMailer(Properties javamailProps)
|
|
| Method Summary | |
|---|---|
Message |
buildMessage()
Build a complete message ready for sending. |
Authenticator |
createAuthenticator()
Helper method to create an Authenticator based on Password Authentication |
MimeBodyPart |
createFileAttachment(File file)
Create a file attachment as a MimeBodyPart, checking to see if the file exists before we create the attachment. |
String |
getCharSet()
|
String |
getContentType()
|
String |
getEncoding()
|
String |
getFileName()
|
String |
getFrom()
|
String |
getMailer()
|
String |
getMailHost()
|
Properties |
getMailProps()
This returns the properties configured in the javamail-configuration.properties file. |
String |
getMessageText()
|
String |
getPassword()
|
Session |
getSession()
|
int |
getSmtpPort()
|
String |
getSubject()
|
String |
getTo()
|
String |
getTransport()
|
String |
getUser()
|
boolean |
isAuthenticate()
|
boolean |
isDebug()
|
boolean |
isQuitWait()
|
boolean |
isSmtpSsl()
|
boolean |
isStartTlsEnabled()
|
boolean |
isUseJMTA()
|
void |
mailSend()
Sends a message based on properties set on this bean. |
void |
sendMessage(Message message)
Send message. |
void |
setAuthenticate(boolean authenticate)
|
void |
setCharSet(String charSet)
|
void |
setContentType(String contentType)
|
void |
setDebug(boolean debug)
|
void |
setEncoding(String encoding)
|
void |
setFileName(String fileName)
|
void |
setFrom(String from)
|
void |
setMailer(String mailer)
|
void |
setMailHost(String mail_host)
|
void |
setMessageText(String messageText)
|
void |
setPassword(String password)
|
void |
setQuitWait(boolean quitWait)
|
void |
setSession(Session session)
|
void |
setSmtpPort(int smtpPort)
|
void |
setSmtpSsl(boolean smtpSsl)
|
void |
setStartTlsEnabled(boolean startTlsEnabled)
|
void |
setSubject(String subject)
|
void |
setTo(String to)
|
void |
setTransport(String transport)
|
void |
setUseJMTA(boolean useMTA)
|
void |
setUser(String user)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JavaMailer(Properties javamailProps)
throws JavaMailerException
JavaMailerException
public JavaMailer()
throws JavaMailerException
IOException
JavaMailerException| Method Detail |
|---|
public void mailSend()
throws JavaMailerException
JavaMailerExceptionpublic Authenticator createAuthenticator()
public Message buildMessage()
throws JavaMailerException
session - session to use to create a new MimeMessage
JavaMailerException - if any of the underlying operations fail
public MimeBodyPart createFileAttachment(File file)
throws MessagingException,
JavaMailerException
file - file to attach
MessagingException - if we can't set the data handler or
the file name on the MimeBodyPart
JavaMailerException - if the file does not exist or is not
readable
public void sendMessage(Message message)
throws JavaMailerException
session - message -
JavaMailerExceptionpublic String getPassword()
public void setPassword(String password)
password - The password to set.public String getUser()
public void setUser(String user)
user - The user to set.public boolean isUseJMTA()
public void setUseJMTA(boolean useMTA)
mailHost - The _useMailHost to set.public String getFrom()
public void setFrom(String from)
from - The from address to set.public boolean isAuthenticate()
public void setAuthenticate(boolean authenticate)
authenticate - The authenticate boolean to set.public String getFileName()
public void setFileName(String fileName)
file - Sets the file name to be attached to the messaget.public String getMailHost()
public void setMailHost(String mail_host)
mail_host - Sets the mail host.public String getMailer()
public void setMailer(String mailer)
mailer - Sets the mailer.public String getMessageText()
public void setMessageText(String messageText)
messageText - Sets the message text.public String getSubject()
public void setSubject(String subject)
subject - Sets the message Subject.public String getTo()
public void setTo(String to)
to - Sets the To address.public String getTransport()
public void setTransport(String transport)
public boolean isDebug()
public void setDebug(boolean debug)
public Session getSession()
public void setSession(Session session)
session - the session to setpublic String getContentType()
public void setContentType(String contentType)
contentType - the contentType to setpublic String getCharSet()
public void setCharSet(String charSet)
charSet - the charSet to setpublic String getEncoding()
public void setEncoding(String encoding)
encoding - the encoding to setpublic boolean isStartTlsEnabled()
public void setStartTlsEnabled(boolean startTlsEnabled)
startTlsEnabled - the startTlsEnabled to setpublic boolean isQuitWait()
public void setQuitWait(boolean quitWait)
quitWait - the quitWait to setpublic int getSmtpPort()
public void setSmtpPort(int smtpPort)
smtpPort - the smtpPort to setpublic boolean isSmtpSsl()
public void setSmtpSsl(boolean smtpSsl)
smtpSsl - the smtpSsl to setpublic Properties getMailProps()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||