|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enableit.tools.email.ejb.EmailBean
An EJB for sending email.
Field Summary | |
static java.lang.String |
ABOUT
CVS info about this class and its current version |
static java.lang.String |
MT_BINARY
A valid message content type |
static java.lang.String |
MT_HTML
A valid message content type |
static java.lang.String |
MT_PLAIN_TEXT
A valid message content type |
Constructor Summary | |
EmailBean()
Default constructor. |
Method Summary | |
void |
ejbCreate()
Called by container when creating new bean instance. |
protected void |
initialise()
Initialise the bean configurations from JNDI tree. |
protected void |
initialise(java.lang.String protocol,
java.lang.String mbox,
java.lang.String send,
java.lang.String host,
java.lang.String user,
java.lang.String passwd,
java.lang.String mailer,
java.lang.String from,
java.lang.Boolean debug,
java.lang.String blankSubject)
Initialise the bean configurations from params. |
void |
sendEmail(EmailConfigBean bean)
Sends an email made up of a message and an attachment. |
void |
sendEmail(java.lang.String to,
java.lang.String from,
java.lang.String subject,
java.lang.String message)
Sends an email message using the Mail server configured in the JNDI environment. |
void |
sendEmail(java.lang.String to,
java.lang.String from,
java.lang.String subject,
java.lang.String message,
java.lang.String attachmentText)
Sends an email message using the Mail server configured in the JNDI environment and creates an attachment too. |
void |
sendEmail(java.lang.String to,
java.lang.String from,
java.lang.String subject,
java.lang.String message,
java.net.URL attachmentUrl)
Sends an email made up of a message and an attachment. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String MT_PLAIN_TEXT
public static final java.lang.String MT_HTML
public static final java.lang.String MT_BINARY
public static final java.lang.String ABOUT
Constructor Detail |
public EmailBean()
Method Detail |
public void ejbCreate() throws javax.ejb.CreateException, javax.ejb.EJBException
protected void initialise()
protected void initialise(java.lang.String protocol, java.lang.String mbox, java.lang.String send, java.lang.String host, java.lang.String user, java.lang.String passwd, java.lang.String mailer, java.lang.String from, java.lang.Boolean debug, java.lang.String blankSubject)
This method is really only intended for testing purposes, though it could also be used to initialise this class as a simple class, rather than an EJB.
protocol
- The mail protocol to configure with.mbox
- Not used since no mailbox is ever read.send
- JavaMail property 'send'host
- The outgoing mail host.user
- User to authenticate with on the outgoing mail server.passwd
- Password (plain text) to authenticate with on the
outgoing mail server.mailer
- JavaMail property 'mailer'from
- Default for the mail 'from' field if not provided on send.debug
- Whether to use a debug mail session.blankSubject
- The subject to use when the caller of sendEmail
does not provide one (may be blank but may not be null).public void sendEmail(java.lang.String to, java.lang.String from, java.lang.String subject, java.lang.String message) throws java.rmi.RemoteException
to
- Target email address.from
- Message 'from' address. If supplied this overrides the
default in the JNDI context.subject
- Subject for the mail message.message
- Body text for the mail message.java.rmi.RemoteException
- System exception, notably
misconfiguration of mail server.public void sendEmail(java.lang.String to, java.lang.String from, java.lang.String subject, java.lang.String message, java.lang.String attachmentText) throws java.rmi.RemoteException
to
- Target email address.from
- Message 'from' address. If supplied this overrides the
default in the JNDI context.subject
- Subject for the mail message.message
- Body text for the mail message.attachmentText
- Text to create as a text/plain attachment.java.rmi.RemoteException
- System exception, notably
misconfiguration of mail server.public void sendEmail(java.lang.String to, java.lang.String from, java.lang.String subject, java.lang.String message, java.net.URL attachmentUrl) throws java.rmi.RemoteException
to
- Target email address.from
- Message 'from' address. If supplied this overrides the
default in the JNDI context.subject
- Subject for the mail message.message
- Body text for the mail message.attachmentUrl
- URL to fetch and create as an attachment.java.rmi.RemoteException
- System exception, notably
misconfiguration of mail server.public void sendEmail(EmailConfigBean bean) throws java.rmi.RemoteException
bean
- An EmailConfigBean
containing all the details
for the message.java.rmi.RemoteException
- System exception, notably
misconfiguration of mail server.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |