|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.mail.Authenticator
com.sibvisions.util.Mail
public final class Mail
The Mail
class is a utility class for sending mails.
Field Summary | |
---|---|
static java.lang.String |
CONTENT_HTML
the html content. |
static java.lang.String |
CONTENT_TEXT
the plain text content. |
Constructor Summary | |
---|---|
Mail(java.lang.String pHost,
java.lang.String pSmtpPort)
Creates a new instance of Mail with a specific mailserver and smtp port. |
|
Mail(java.lang.String pHost,
java.lang.String pSmtpPort,
java.lang.String pUserName,
java.lang.String pPassword)
Creates a new instance of Mail with a specific mailserver, smtp port and
authentication credentials. |
Method Summary | |
---|---|
java.lang.String |
getContentType()
Gets the content type. |
protected javax.mail.PasswordAuthentication |
getPasswordAuthentication()
|
java.lang.Object |
getProperty(java.lang.String pName)
Gets the value of a property. |
boolean |
isTLSEnabled()
Gets whether TLS is enabled. |
void |
send(java.lang.String pFrom,
java.lang.String pTo,
java.lang.String pSubject,
java.lang.String pText)
Sends a plain text mail. |
void |
send(java.lang.String pFrom,
java.lang.String pTo,
java.lang.String pCc,
java.lang.String pSubject,
java.lang.String pText)
Sends a plain text mail. |
void |
send(java.lang.String pFrom,
java.lang.String pTo,
java.lang.String pCc,
java.lang.String pSubject,
java.lang.String pText,
java.lang.String pFilename,
java.lang.Object pContent)
Sends a plain text mail. |
void |
send(java.lang.String pFrom,
java.lang.String pTo,
java.lang.String pCc,
java.lang.String pBcc,
java.lang.String pSubject,
java.lang.String pText,
java.lang.String pFilename,
java.lang.Object pContent)
Sends a plain text mail. |
void |
setContentType(java.lang.String pContentType)
Sets the content type. |
void |
setProperty(java.lang.String pName,
java.lang.String pValue)
Sets or removes a property. |
void |
setTLSEnabled(boolean pEnable)
Sets whether TLS is enabled. |
Methods inherited from class javax.mail.Authenticator |
---|
getDefaultUserName, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingSite |
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 CONTENT_TEXT
public static final java.lang.String CONTENT_HTML
Constructor Detail |
---|
public Mail(java.lang.String pHost, java.lang.String pSmtpPort)
Mail
with a specific mailserver and smtp port.
pHost
- the hostname or ip address of the mailserverpSmtpPort
- the smtp port of the mailserverpublic Mail(java.lang.String pHost, java.lang.String pSmtpPort, java.lang.String pUserName, java.lang.String pPassword)
Mail
with a specific mailserver, smtp port and
authentication credentials.
pHost
- the hostname or ip address of the mailserverpSmtpPort
- the smtp port of the mailserverpUserName
- the username for smtp authenticationpPassword
- the password for smtp authenticationMethod Detail |
---|
protected javax.mail.PasswordAuthentication getPasswordAuthentication()
getPasswordAuthentication
in class javax.mail.Authenticator
public void setContentType(java.lang.String pContentType)
pContentType
- the content typepublic java.lang.String getContentType()
public void setProperty(java.lang.String pName, java.lang.String pValue)
pName
- the namepValue
- the value or null
to remove the propertypublic java.lang.Object getProperty(java.lang.String pName)
pName
- the name
public void setTLSEnabled(boolean pEnable)
pEnable
- true
to enable, false
otherwisepublic boolean isTLSEnabled()
true
if enabled, false
otherwisepublic void send(java.lang.String pFrom, java.lang.String pTo, java.lang.String pSubject, java.lang.String pText) throws java.lang.Exception
pFrom
- the senderpTo
- the recipient(s) comma separatedpSubject
- the subject of the messagepText
- the text of the message
java.lang.Exception
- if the send operation failedpublic void send(java.lang.String pFrom, java.lang.String pTo, java.lang.String pCc, java.lang.String pSubject, java.lang.String pText) throws java.lang.Exception
pFrom
- the senderpTo
- the recipient(s) comma separatedpCc
- the carbon copy recipient(s) comma separatedpSubject
- the subject of the messagepText
- the text of the message
java.lang.Exception
- if the send operation failedpublic void send(java.lang.String pFrom, java.lang.String pTo, java.lang.String pCc, java.lang.String pSubject, java.lang.String pText, java.lang.String pFilename, java.lang.Object pContent) throws java.lang.Exception
pFrom
- the senderpTo
- the recipient(s) comma separatedpCc
- the carbon copy recipient(s) comma separatedpSubject
- the subject of the messagepText
- the text of the messagepFilename
- the file namepContent
- the content
java.lang.Exception
- if the send operation failedpublic void send(java.lang.String pFrom, java.lang.String pTo, java.lang.String pCc, java.lang.String pBcc, java.lang.String pSubject, java.lang.String pText, java.lang.String pFilename, java.lang.Object pContent) throws java.lang.Exception
pFrom
- the senderpTo
- the recipient(s) comma separatedpCc
- the carbon copy recipient(s) comma separatedpBcc
- the carbon copy recipient(s) comma separatedpSubject
- the subject of the messagepText
- the text of the messagepFilename
- the file namepContent
- the content
java.lang.Exception
- if the send operation failed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |