|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.javamail.ERMailUtils
public class ERMailUtils
ERMailUtils
contains various utility method related to mail sending.
Constructor Summary | |
---|---|
ERMailUtils()
|
Method Summary | |
---|---|
static com.webobjects.foundation.NSArray<java.lang.String> |
convertInternetAddressesToNSArray(javax.mail.Address[] addressesArray)
Method that converts Address [] loaded with either Address or InternetAddress objects to NSArray of String emails. |
static javax.mail.internet.InternetAddress[] |
convertNSArrayToInternetAddresses(com.webobjects.foundation.NSArray addrs)
Method that converts NSArray of String emails to InternetAddress []. |
static javax.mail.internet.InternetAddress[] |
convertNSDictionaryToInternetAddresses(com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.String> addrs,
java.lang.String charset)
Method that converts NSDictionary consisting of String emails as keys and String personal names to InternetAddress []. |
static java.lang.String |
encodeString(java.lang.String string,
java.lang.String charset)
|
static com.webobjects.appserver.WOComponent |
instantiatePage(java.lang.String pageName,
com.webobjects.foundation.NSDictionary sessionDict)
Augmented version of the method found in ERXApplication . |
static void |
sendHTMLMail(ERMailDeliveryHTML delivery,
java.lang.String pageName,
java.lang.String alternatePageName,
java.lang.String emailFrom,
java.lang.String emailTo,
java.lang.String emailReplyTo,
java.lang.String subject)
Use this method to send an HTML mail. |
static void |
sendHTMLMail(java.lang.String pageName,
java.lang.String alternatePageName,
java.lang.String emailFrom,
java.lang.String emailTo,
java.lang.String emailReplyTo,
java.lang.String subject)
Use this method to send an HTML mail, but default mail delivery. |
static void |
setDictionaryValuesInSession(com.webobjects.foundation.NSDictionary dict,
com.webobjects.appserver.WOSession session)
This method sets the values found in a dictionary into the session's state dictionary. |
static ERMailDeliveryHTML |
sharedDeliverer()
Accessor to the shared instance of a ERMailDeliveryHTML. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ERMailUtils()
Method Detail |
---|
public static ERMailDeliveryHTML sharedDeliverer()
ERMailDeliveryHTML
singletonpublic static com.webobjects.appserver.WOComponent instantiatePage(java.lang.String pageName, com.webobjects.foundation.NSDictionary sessionDict)
ERXApplication
. Used to instantiate a WOComponent, typically
outside of a session.
pageName
- The name of the WOComponent that must be instantiated.sessionDict
- can be provided in order to set objects/keys in the newly created session of the component. This is
useful when one want to preserve state when sending a mail.
WOComponent
.public static void sendHTMLMail(ERMailDeliveryHTML delivery, java.lang.String pageName, java.lang.String alternatePageName, java.lang.String emailFrom, java.lang.String emailTo, java.lang.String emailReplyTo, java.lang.String subject)
delivery
- the ERMailDeliveryHTML
used to send the mail.pageName
- The name of the WOComponent that must be instantiated.alternatePageName
- The name of the WOComponent that represents for the text that must be displayed when an alternate
plain text version of the mail needs to be provided.emailFrom
- the email address the mail is sent fromemailTo
- the email address the mail is sent toemailReplyTo
- the email address where the mail must be replied-to.subject
- the subject of the mailpublic static void sendHTMLMail(java.lang.String pageName, java.lang.String alternatePageName, java.lang.String emailFrom, java.lang.String emailTo, java.lang.String emailReplyTo, java.lang.String subject)
pageName
- The name of the WOComponent that must be instantiated.alternatePageName
- The name of the WOComponent that represents for the text that must be displayed when an alternate
plain text version of the mail needs to be provided.emailFrom
- the email address the mail is sent fromemailTo
- the email address the mail is sent toemailReplyTo
- the email address where the mail must be replied-to.subject
- the subject of the mailpublic static void setDictionaryValuesInSession(com.webobjects.foundation.NSDictionary dict, com.webobjects.appserver.WOSession session)
ERMailUtils.instantiatePage
or ERXApplication.instantiatePage
.)
dict
- a NSDictionary
value containing the values we want to set in the session parameter.session
- a WOSession
value that will receive the values contained in the dict parameter.public static java.lang.String encodeString(java.lang.String string, java.lang.String charset)
public static javax.mail.internet.InternetAddress[] convertNSArrayToInternetAddresses(com.webobjects.foundation.NSArray addrs) throws javax.mail.internet.AddressException
addrs
- a NSArray
value
InternetAddress[]
value
javax.mail.internet.AddressException
- if an error occurspublic static com.webobjects.foundation.NSArray<java.lang.String> convertInternetAddressesToNSArray(javax.mail.Address[] addressesArray)
Note that this method will not only accept Address [] but also InternetAddress [].
addressesArray
- an Address[]
value
NSArray
value
javax.mail.internet.AddressException
- if an error occurspublic static javax.mail.internet.InternetAddress[] convertNSDictionaryToInternetAddresses(com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.String> addrs, java.lang.String charset) throws javax.mail.internet.AddressException
addrs
- a NSDictionary
with email, personal name as key value paircharset
- a String
of the charset to use for personal string
InternetAddress[]
value
javax.mail.internet.AddressException
- if an error occurs
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |