public class EmailExtensions extends Object
| Constructor and Description |
|---|
EmailExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static EmailMessage |
addToRecipientToEmailMessage(String recipientEmail,
String recipientPersonal,
String recipientCharset,
EmailMessage emailMessage)
Adds a 'to' recipient to the email message.
|
static Address[] |
getAddressArray(Address... address)
Gets the address array from the given address objects.
|
static String |
getCharsetFromContentType(String type)
Gets the encoding from the header.
|
static String |
getString(DataHandler dataHandler)
Gets the string from the given
DataHandler. |
static Address |
newAddress(String address)
Creates an Address from the given the email address as String object.
|
static Address |
newAddress(String emailAddress,
String personal)
Creates from the given the address and personal name an Adress-object.
|
static Address |
newAddress(String address,
String personal,
String charset)
Creates an Address from the given the address and personal name.
|
static EmailMessage |
setFromToEmailMessage(String senderEmail,
String senderPersonal,
String senderCharset,
EmailMessage emailMessage)
Sets the from to the email message.
|
static boolean |
validateEmailAdress(String emailAddress)
Validate the given email address.
|
public static EmailMessage addToRecipientToEmailMessage(String recipientEmail, String recipientPersonal, String recipientCharset, EmailMessage emailMessage) throws UnsupportedEncodingException, MessagingException
recipientEmail - the recipient emailrecipientPersonal - the recipient personalrecipientCharset - the recipient charsetemailMessage - the email messageUnsupportedEncodingException - is thrown if the encoding not supportedMessagingException - is thrown if the underlying implementation does not support modification of
existing valuespublic static Address[] getAddressArray(Address... address)
address - the addresspublic static String getCharsetFromContentType(String type) throws MessagingException
type - The string where the encoding is in.MessagingException - is thrown if the underlying implementation does not support modification of
existing valuespublic static String getString(DataHandler dataHandler) throws IOException
DataHandler.dataHandler - the data handlerIOException - Signals that an I/O exception has occurred.public static Address newAddress(String address) throws AddressException, UnsupportedEncodingException
address - The address in RFC822 format.UnsupportedEncodingException - is thrown if the encoding not supportedAddressException - is thrown if the parse failedpublic static Address newAddress(String emailAddress, String personal) throws AddressException, UnsupportedEncodingException
emailAddress - The address in RFC822 format.personal - The personal name.UnsupportedEncodingException - is thrown if the encoding not supportedAddressException - is thrown if the parse failedpublic static Address newAddress(String address, String personal, String charset) throws AddressException, UnsupportedEncodingException
address - The address in RFC822 format.personal - The personal name.charset - MIME charset to be used to encode the name as per RFC 2047.AddressException - is thrown if the parse failedUnsupportedEncodingException - is thrown if the encoding not supportedpublic static EmailMessage setFromToEmailMessage(String senderEmail, String senderPersonal, String senderCharset, EmailMessage emailMessage) throws UnsupportedEncodingException, MessagingException
senderEmail - the sender emailsenderPersonal - the sender personalsenderCharset - the sender charsetemailMessage - the email messageUnsupportedEncodingException - is thrown if the encoding not supportedMessagingException - is thrown if the underlying implementation does not support modification of
existing valuespublic static boolean validateEmailAdress(String emailAddress)
emailAddress - the email addressCopyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.