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 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)
recipientEmail - the recipient emailrecipientPersonal - the recipient personalrecipientCharset - the recipient charsetemailMessage - the email messagepublic static Address[] getAddressArray(Address... address)
address - the addresspublic static String getCharsetFromContentType(String type) throws MessagingException
type - The string where the encoding is in.MessagingException - if an error occurs.public static Address newAddress(String address) throws AddressException, UnsupportedEncodingException
address - The address in RFC822 format.AddressException - if an error occurs.UnsupportedEncodingException - if an error occurs.public static Address newAddress(String emailAddress, String personal) throws AddressException, UnsupportedEncodingException
emailAddress - The address in RFC822 format.personal - The personal name.UnsupportedEncodingException - the unsupported encoding exceptionAddressException - the address exceptionpublic 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 - if an error occurs.UnsupportedEncodingException - if an error occurs.public static EmailMessage setFromToEmailMessage(String senderEmail, String senderPersonal, String senderCharset, EmailMessage emailMessage)
senderEmail - the sender emailsenderPersonal - the sender personalsenderCharset - the sender charsetemailMessage - the email messagepublic static boolean validateEmailAdress(String emailAddress)
emailAddress - the email addressCopyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.