|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--com.email.EmailCarrier
Author : Sameer Bagade
Version : 1.0
| Field Summary | |
static int |
MESSAGE_TYPE_HTML
int value to set content type for html format |
static int |
MESSAGE_TYPE_TEXT
int value to set content type for text format |
static int |
RECIPIENT_TYPE_BCC
int value to represent recipient type for BCC |
static int |
RECIPIENT_TYPE_CC
int value to represent recipient type for CC |
static int |
RECIPIENT_TYPE_TO
int value to represent recipient type for TO |
| Constructor Summary | |
EmailCarrier()
Creates new EmailCarrier |
|
| Method Summary | |
java.util.Hashtable |
getAttachments()
Gets all attachments |
java.util.ArrayList |
getBCCList()
Get the recipient list of email for BCC. |
java.util.ArrayList |
getCCList()
Get the recipient list of email for CC. |
java.lang.String |
getFrom()
Get email address of Sender. |
java.lang.String |
getMsg()
Get the email message. |
java.lang.String |
getSmtpHost()
Get the SMTP mail server address. |
java.lang.String |
getSubject()
Get the email subject. |
java.util.ArrayList |
getToList()
Get the recipient list of email for TO. |
void |
insertAttachments(java.util.Hashtable pAttachments,
java.lang.String pMsg,
int pMsgType)
Inserts attachments. |
void |
insertAttachments(java.lang.String[] pAttachments,
java.lang.String pMsg,
int pMsgType)
Inserts attachments. |
void |
insertAttachments(java.lang.String pAttachments,
java.lang.String pMsg,
int pMsgType)
Inserts attachments. |
static boolean |
isValid(java.util.Hashtable obj)
checks the validity of an String array object |
static boolean |
isValid(java.lang.String[] obj)
checks the validity of an String array object |
boolean |
isValidEmail(java.lang.String str)
Validates an email addres |
static java.lang.String |
makeValid(java.lang.String obj)
checks the validity of an String object and converts to empty String if its null |
static boolean |
sendEmail(java.lang.String host,
java.lang.String pFrom,
java.lang.String[] pTo,
java.lang.String[] pCC,
java.lang.String[] pBCC,
java.lang.String pSub,
java.lang.String pMsg,
java.util.Hashtable pAttachment,
int pMsgType)
Sends an Email to specified recipients in an array with many attachments |
static boolean |
sendEmail(java.lang.String host,
java.lang.String pFrom,
java.lang.String pTo,
java.lang.String pCC,
java.lang.String pBCC,
java.lang.String pSub,
java.lang.String pMsg,
java.util.Hashtable pAttachment,
int pMsgType)
Sends an Email to specified recipients with many attachments |
static boolean |
sendEmail(java.lang.String host,
java.lang.String pFrom,
java.lang.String pTo,
java.lang.String pCC,
java.lang.String pBCC,
java.lang.String pSub,
java.lang.String pMsg,
int pMsgType)
Sends an Email to specified recipients with no attachments |
static boolean |
sendEmail(java.lang.String host,
java.lang.String pFrom,
java.lang.String pTo,
java.lang.String pCC,
java.lang.String pBCC,
java.lang.String pSub,
java.lang.String pMsg,
java.lang.String pAttachment,
java.lang.String pDisplayName,
int pMsgType)
Sends an Email to specified recipients in an array with one attachment |
boolean |
sendEmailCarrier()
processes and transports emails. |
void |
setAttachments(java.util.Hashtable pAttachments)
Sets the attachments |
void |
setBCCList(java.util.ArrayList pBCCList)
Set the recipient list of email for BCC. |
void |
setCCList(java.util.ArrayList pCCList)
Set the recipient list of email for CC. |
void |
setContent(java.lang.String pMsg,
int pMsgType)
Sets the message and content type for text email without attachment |
void |
setFrom(java.lang.String pFrom)
Set email address of Sender. |
void |
setMessageSubject(java.lang.String pMessageSubject)
Set the email subject |
void |
setMessageText(java.lang.String pMessageText)
Set the email message text |
void |
setRecipients(int recipient_type,
java.lang.String recipient_addr)
Sets the recipient to the list according to the recipient_type |
void |
setRecipients(int recipient_type,
java.lang.String[] recipient_addr)
Sets the recipient to the list according to the recipient_type |
void |
setSmtpHost(java.lang.String pHost)
Set the SMTP mail server address. |
void |
setToList(java.util.ArrayList pToList)
Set the recipient list of email for TO. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int RECIPIENT_TYPE_TO
public static final int RECIPIENT_TYPE_CC
public static final int RECIPIENT_TYPE_BCC
public static final int MESSAGE_TYPE_TEXT
public static final int MESSAGE_TYPE_HTML
| Constructor Detail |
public EmailCarrier()
| Method Detail |
public static boolean sendEmail(java.lang.String host,
java.lang.String pFrom,
java.lang.String pTo,
java.lang.String pCC,
java.lang.String pBCC,
java.lang.String pSub,
java.lang.String pMsg,
int pMsgType)
throws java.lang.Exception
host - SMTP Mail Server AddresspFrom - An email address of a senderpTo - A String containing email addresses of recipients in TO ListpCC - A String containing email addresses of recipients in CC ListpBCC - A String containing email addresses of recipients in BCC ListpSub - Subject of an emailpMsg - Text message to be send with an emailpMsgType - int to set the message type
MESSAGE_TYPE_TEXT for text messages
MESSAGE_TYPE_HTML for TML messagesjava.lang.Exception - java.lang.Exception
public static boolean sendEmail(java.lang.String host,
java.lang.String pFrom,
java.lang.String pTo,
java.lang.String pCC,
java.lang.String pBCC,
java.lang.String pSub,
java.lang.String pMsg,
java.lang.String pAttachment,
java.lang.String pDisplayName,
int pMsgType)
throws java.lang.Exception
host - SMTP Mail Server AddresspFrom - An email address of a senderpTo - Email address of recipients in TO ListpCC - Email address of recipients in CC ListpBCC - Email addresses of recipients in BCC ListpSub - Subject of an emailpMsg - Text message to be send with an emailpAttachment - Path and file name to be attachedpDisplayName - File name to show attachment in emailpMsgType - int to set the message type
MESSAGE_TYPE_TEXT for text messages
MESSAGE_TYPE_HTML for TML messagesjava.lang.Exception - java.lang.Exception
public static boolean sendEmail(java.lang.String host,
java.lang.String pFrom,
java.lang.String pTo,
java.lang.String pCC,
java.lang.String pBCC,
java.lang.String pSub,
java.lang.String pMsg,
java.util.Hashtable pAttachment,
int pMsgType)
throws java.lang.Exception
host - SMTP Mail Server AddresspFrom - An email address of a senderpTo - A String containing email addresses of recipients in TO ListpCC - A String containing email addresses of recipients in CC ListpBCC - A String containing email addresses of recipients in BCC ListpSub - Subject of an emailpMsg - Text message to be send with an emailpAttachment - A Hashtable of key value pair of display file name and full path and file name of attachmentpMsgType - int to set the message type
MESSAGE_TYPE_TEXT for text messages
MESSAGE_TYPE_HTML for TML messagesjava.lang.Exception - java.lang.Exception
public static boolean sendEmail(java.lang.String host,
java.lang.String pFrom,
java.lang.String[] pTo,
java.lang.String[] pCC,
java.lang.String[] pBCC,
java.lang.String pSub,
java.lang.String pMsg,
java.util.Hashtable pAttachment,
int pMsgType)
throws java.lang.Exception
host - SMTP Mail Server AddresspFrom - An email address of a senderpTo - An array of String containing email addresses of recipients in TO ListpCC - An array of String containing email addresses of recipients in CC ListpBCC - An array of String containing email addresses of recipients in BCC ListpSub - Subject of an emailpMsg - Text message to be send with an emailpAttachment - A Hashtable of key value pair of display file name and full path and file name of attachmentpMsgType - int to set the message type
MESSAGE_TYPE_TEXT for text messages
MESSAGE_TYPE_HTML for TML messagesjava.lang.Exception - java.lang.Exception
public void setContent(java.lang.String pMsg,
int pMsgType)
throws java.lang.Exception
pMsg - String message to setpMsgType - int to set message typejava.lang.Exception - java.lang.Exceptionpublic java.util.Hashtable getAttachments()
public void setAttachments(java.util.Hashtable pAttachments)
pAttachments - Hashtable having key value pair of display file name and full file path with namepublic boolean isValidEmail(java.lang.String str)
str - An email address to be validatedpublic static boolean isValid(java.lang.String[] obj)
obj - Array of String to be validatedpublic static java.lang.String makeValid(java.lang.String obj)
obj - String to be validatedpublic static boolean isValid(java.util.Hashtable obj)
obj - Hashtable to be validatedpublic java.lang.String getSmtpHost()
public void setSmtpHost(java.lang.String pHost)
pHost - the SMTP mail server addresspublic java.lang.String getFrom()
public void setFrom(java.lang.String pFrom)
pFrom - email address of senderpublic java.lang.String getMsg()
public java.lang.String getSubject()
public java.util.ArrayList getToList()
public void setToList(java.util.ArrayList pToList)
pToList - ArrayList of email addresses to be set in TO listpublic java.util.ArrayList getCCList()
public void setCCList(java.util.ArrayList pCCList)
pCCList - ArrayList of email addresses to be set in CC listpublic java.util.ArrayList getBCCList()
public void setBCCList(java.util.ArrayList pBCCList)
pBCCList - ArrayList of email addresses to be set in BCC list
public void setRecipients(int recipient_type,
java.lang.String recipient_addr)
throws javax.mail.internet.AddressException,
java.lang.Exception
recipient_type - RECIPIENT_TYPE_TO for TO
RECIPIENT_TYPE_CC for CC
RECIPIENT_TYPE_BCC for BCCrecipient_addr - recipient email addressjavax.mail.internet.AddressException - javax.mail.internet.AddressException
The exception thrown when a wrongly formatted address is encountered.java.lang.Exception - java.lang.Exception
public void setRecipients(int recipient_type,
java.lang.String[] recipient_addr)
throws javax.mail.internet.AddressException,
java.lang.Exception
recipient_type - RECIPIENT_TYPE_TO for TO
RECIPIENT_TYPE_CC for CC
RECIPIENT_TYPE_BCC for BCCrecipient_addr - array of String containing email addresses of recipientjavax.mail.internet.AddressException - javax.mail.internet.AddressException
The exception thrown when a wrongly formatted address is encountered.java.lang.Exception - java.lang.Exception
public void setMessageText(java.lang.String pMessageText)
throws javax.mail.MessagingException
pMessageText - Message text for emailjavax.mail.MessagingException - The base class for all exceptions thrown by the Messaging classes
public void setMessageSubject(java.lang.String pMessageSubject)
throws javax.mail.MessagingException
pMessageSubject - Subject of emailjavax.mail.MessagingException - javax.mail.MessagingException
The base class for all exceptions thrown by the Messaging classes
public void insertAttachments(java.lang.String[] pAttachments,
java.lang.String pMsg,
int pMsgType)
throws java.lang.Exception
pAttachments - An array of String having attachment path and file namepMsgType - int to set the message type
MESSAGE_TYPE_TEXT for text messages
MESSAGE_TYPE_HTML for TML messagespMsg - Text message to be send with an emailjava.lang.Exception - java.lang.Exception
public void insertAttachments(java.util.Hashtable pAttachments,
java.lang.String pMsg,
int pMsgType)
throws java.lang.Exception
pAttachments - An array of String having attachment path and file namepMsgType - int to set the message type
MESSAGE_TYPE_TEXT for text messages
MESSAGE_TYPE_HTML for TML messagespMsg - Text message to be send with an emailjava.lang.Exception - java.lang.Exception
public void insertAttachments(java.lang.String pAttachments,
java.lang.String pMsg,
int pMsgType)
throws java.lang.Exception
pAttachments - A String contating attachment path and file namepMsgType - int to set the message type
MESSAGE_TYPE_TEXT for text messages
MESSAGE_TYPE_HTML for TML messagespMsg - Text message to be send with an emailjava.lang.Exception - java.lang.Exception
public boolean sendEmailCarrier()
throws java.lang.Exception
java.lang.Exception - java.lang.Exception
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||