|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.davesag.generica.util.Mailer
This is a general purpose class for setting up standard email messages using the javax mail API.
| Field Summary | |
protected boolean |
isAuthenticating
|
protected String |
theAuthenticatedPassword
|
protected String |
theAuthenticatedUser
|
protected List |
theBcc
|
protected List |
theCc
|
protected List |
theFiles
|
protected String |
theFrom
|
protected Map |
theHeaders
|
protected String |
theHost
|
protected Properties |
theMailProps
|
protected javax.mail.Session |
theMailSession
|
protected javax.mail.Message |
theMessage
|
protected List |
theMessages
|
protected List |
theReplyTo
|
protected List |
theSig
|
protected String |
theSubject
|
protected List |
theTo
|
protected List |
theUris
|
| Constructor Summary | |
Mailer()
No arg constructor. |
|
| Method Summary | |
void |
addBcc(String bcc)
Adds an email address to the bcc field of the mail message |
void |
addBCC(String[] bcc)
Adds an array of bcc addresses to the mail message. |
void |
addCc(String cc)
Add a CC address to the message. |
void |
addCcs(String[] ccs)
Add an array of CC address to the message. |
void |
addEncloseFile(String file)
Adds an enclosure file to the message |
void |
addEncloseFiles(String[] files)
Adds an array of enclosure files to the message. |
void |
addEncloseUri(String uri)
Adds an enclosure uri to the message. |
void |
addEncloseUris(String[] uris)
Adds an array of enclosure uris to the message. |
void |
addHeader(String name,
String value)
Adds header parameters to a Map of headers. |
void |
addMessage(String msg)
Adds a message that is apppended in sequence to the message body. |
void |
addMessages(String[] msg)
Adds an arrays of message strings to the message body. |
void |
addReplyTo(String replyto)
Adds a reply-to addresses to the mail message. |
void |
addSignature(String sig)
Adds a signature text for the message. |
void |
addTo(String to)
Add a TO address to the message. |
void |
addTos(String[] tos)
Adds an array of To addresses to the message. |
boolean |
sendMail()
Send the email. |
void |
setAuthentication(String username,
String password)
sets the authentication username and password. |
void |
setDebug(String debug)
Sets the debug mode |
void |
setFrom(String from)
Sets the from address. |
void |
setHost(String host)
Sets the SMTP server to use. |
void |
setSubject(String subject)
Sets the subject text for the message. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected String theAuthenticatedUser
protected String theAuthenticatedPassword
protected boolean isAuthenticating
protected String theFrom
protected String theHost
protected String theSubject
protected Properties theMailProps
protected javax.mail.Session theMailSession
protected javax.mail.Message theMessage
protected Map theHeaders
protected List theReplyTo
protected List theTo
protected List theCc
protected List theBcc
protected List theMessages
protected List theUris
protected List theFiles
protected List theSig
| Constructor Detail |
public Mailer()
| Method Detail |
public boolean sendMail()
public void setHost(String host)
host - The hostname of the SMTP server.public void setFrom(String from)
from - The address the email is from.public void addMessage(String msg)
msg - The message to append to the email.public void addMessages(String[] msg)
msg - The array of messages.
public void addHeader(String name,
String value)
name - The header namevalue - The header valuepublic void addReplyTo(String replyto)
replyto - The email address the recipient should reply to.public void addBcc(String bcc)
bcc - An email address to the bcc field of the mail messagepublic void addBCC(String[] bcc)
bcc - The array of email addresses to add to the BCC field.public void addSignature(String sig)
sig - The signature to add.public void setSubject(String subject)
subject - The subject field of the message.public void addCc(String cc)
cc - The CC address to add.public void addCcs(String[] ccs)
ccs - the array of CC addresses to add.public void addTo(String to)
to - The to address to add.public void addTos(String[] tos)
tos - An array of email addresses to add to the TO field.public void setDebug(String debug)
debug - The debug mode "true" or "nosend" mean isDebug is true.public void addEncloseFile(String file)
file - The file to add to the message.public void addEncloseFiles(String[] files)
files - the array of files to add.public void addEncloseUri(String uri)
uri - The enclosure uri.public void addEncloseUris(String[] uris)
uris - Array of uris. This method will trip any white space from
the supplied uris.
public void setAuthentication(String username,
String password)
username - The username.password - The clear text password.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||