|
||||||||||
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 String |
CONTENT_HTML
the html content. |
static String |
CONTENT_TEXT
the plain text content. |
Constructor Summary | |
---|---|
Mail(String pHost,
String pSmtpPort)
Creates a new instance of Mail with a specific mailserver and smtp port. |
|
Mail(String pHost,
String pSmtpPort,
String pUserName,
String pPassword)
Creates a new instance of Mail with a specific mailserver, smtp port and
authentication credentials. |
Method Summary | |
---|---|
String |
getContentType()
Gets the content type. |
protected PasswordAuthentication |
getPasswordAuthentication()
|
void |
send(String pFrom,
String pTo,
String pCc,
String pSubject,
String pText)
Sends a plain text mail. |
void |
send(String pFrom,
String pTo,
String pCc,
String pSubject,
String pText,
String pFilename,
Object pContent)
Sends a plain text mail. |
void |
setContentType(String pContentType)
Sets the content type. |
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 String CONTENT_TEXT
public static final String CONTENT_HTML
Constructor Detail |
---|
public Mail(String pHost, 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(String pHost, String pSmtpPort, String pUserName, 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 PasswordAuthentication getPasswordAuthentication()
getPasswordAuthentication
in class Authenticator
public void setContentType(String pContentType)
pContentType
- the content typepublic String getContentType()
public void send(String pFrom, String pTo, String pCc, String pSubject, String pText) throws 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
Exception
- if the send operation failedpublic void send(String pFrom, String pTo, String pCc, String pSubject, String pText, String pFilename, Object pContent) throws 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
Exception
- if the send operation failed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |