|
Project Wonder 2.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object er.javamail.ERMailDelivery
This is the main class for sending mail with the JavaMail API.
You typically don't create instances of this class since it is abstract.
You should create instances of its subclasses that fitted with specifical
use cases.
Here is an example of its usage.
ERMailDeliveryHTML mail = new ERMailDeliveryHTML (); mail.setWOComponentContent (mailPage); try { mail.newMail (); mail.setFromAddress (emailFrom); mail.setReplyToAddress (emailReplyTo); mail.setSubject (emailSubject); mail.setToAddresses (new NSArray (toEmailAddresses)); // Send the mail mail.sendMail (); } catch (Exception e) { // do something ... }
Field Summary | |
protected NSMutableArray |
_attachments
NSArray of ERMailAttachment that must be binded to the message as ATTACHEMENT. |
Object |
_callbackObject
Deprecated. |
String |
_charset
|
protected NSMutableArray |
_inlineAttachments
NSArray of ERMailAttachment that must be binded to the message as INLINE. |
protected javax.mail.internet.MimeMessage |
_mimeMessage
Content of sent mail. |
static String |
callBackClassName
Deprecated. |
static String |
callBackMethodName
Deprecated. |
static String |
DefaultCharset
|
Constructor Summary | |
ERMailDelivery()
Default constructor |
|
ERMailDelivery(javax.mail.Session session)
Designated constructor |
Method Summary | |
protected NSMutableArray |
_attachments()
|
protected NSMutableArray |
_inlineAttachments()
|
void |
addAttachment(ERMailAttachment attachment)
|
void |
addInlineAttachment(ERMailAttachment attachment)
|
NSArray |
attachments()
|
protected ERMessage |
buildMessage()
Builds an ERMessage for the current MimeMessage. |
Object |
callbackObject()
Deprecated. |
String |
charset()
|
protected void |
finishMessagePreparation()
|
NSArray |
inlineAttachments()
|
protected javax.mail.internet.InternetAddress |
internetAddressWithEmailAndPersonal(String email,
String personal)
|
protected javax.mail.internet.MimeMessage |
mimeMessage()
|
void |
newMail()
Creates a new mail instance within ERMailDelivery |
protected abstract javax.activation.DataHandler |
prepareMail()
Abstract method called by subclasses for doing pre-processing before sending the mail. |
void |
removeAttachment(ERMailAttachment attachment)
|
void |
sendMail()
Sends the mail immediately. |
void |
sendMail(boolean shouldBlock)
Method used to construct a MimeMessage and then send it. |
protected javax.mail.Session |
session()
|
void |
setBCCAddresses(NSArray bccAddresses)
Sets the bcc-addresses array for the current message instance |
static void |
setCallBackClassWithMethod(String className,
String methodName)
Deprecated. |
void |
setCallbackObject(Object obj)
Deprecated. |
void |
setCCAddresses(NSArray ccAddresses)
Sets the cc-addresses array for the current message instance |
void |
setCharset(String charset)
|
void |
setFromAddress(String fromAddress)
Sets the from address for the current message instance |
void |
setFromAddress(String fromAddress,
String personalName)
Sets the from address for the current message instance using an email and the personal name. |
void |
setInternetAddresses(NSArray addresses,
javax.mail.Message.RecipientType type)
Sets addresses using an NSArray of InternetAddress objects. |
protected void |
setMimeMessage(javax.mail.internet.MimeMessage message)
|
void |
setReplyToAddress(String replyToAddress)
Sets the reply-to address for the current message instance |
protected void |
setSession(javax.mail.Session aSession)
|
void |
setSubject(String subject)
Sets the subject for the current message instance |
void |
setToAddress(String toAddress)
|
void |
setToAddress(String toAddress,
String personalName)
Sets the to address for the current message instance using an email and the personal name. |
void |
setToAddresses(NSArray toAddresses)
Sets the to-addresses array for the current message instance |
void |
setXMailerHeader(String xMailer)
Sets the X-Mailer header for the message. |
String |
xMailerHeader()
Gets the X-Mailer header set on the MimeMessage. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.mail.internet.MimeMessage _mimeMessage
protected NSMutableArray _attachments
protected NSMutableArray _inlineAttachments
public static String callBackClassName
public static String callBackMethodName
public static String DefaultCharset
public String _charset
public Object _callbackObject
Constructor Detail |
public ERMailDelivery(javax.mail.Session session)
public ERMailDelivery()
Method Detail |
public static void setCallBackClassWithMethod(String className, String methodName)
public String charset()
public void setCharset(String charset)
protected javax.mail.Session session()
protected void setSession(javax.mail.Session aSession)
public void newMail()
protected javax.mail.internet.MimeMessage mimeMessage()
protected void setMimeMessage(javax.mail.internet.MimeMessage message)
public void addAttachment(ERMailAttachment attachment)
public void addInlineAttachment(ERMailAttachment attachment)
protected NSMutableArray _inlineAttachments()
public NSArray inlineAttachments()
protected NSMutableArray _attachments()
public NSArray attachments()
public void removeAttachment(ERMailAttachment attachment)
protected javax.mail.internet.InternetAddress internetAddressWithEmailAndPersonal(String email, String personal) throws javax.mail.internet.AddressException
javax.mail.internet.AddressException
public void setFromAddress(String fromAddress) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setFromAddress(String fromAddress, String personalName) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setToAddress(String toAddress) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setToAddress(String toAddress, String personalName) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setToAddresses(NSArray toAddresses) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setReplyToAddress(String replyToAddress) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setCCAddresses(NSArray ccAddresses) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setBCCAddresses(NSArray bccAddresses) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setCallbackObject(Object obj)
public Object callbackObject()
public void setSubject(String subject) throws javax.mail.MessagingException
javax.mail.MessagingException
public void setXMailerHeader(String xMailer) throws javax.mail.MessagingException
xMailer
- value to set
javax.mail.MessagingException
public String xMailerHeader() throws javax.mail.MessagingException
javax.mail.MessagingException
protected ERMessage buildMessage()
public void sendMail()
public void sendMail(boolean shouldBlock)
NSForwardException
.
shouldBlock
- boolean to indicate if the message should be
added to a queue or sent directly.protected void finishMessagePreparation() throws javax.mail.MessagingException
javax.mail.MessagingException
public void setInternetAddresses(NSArray addresses, javax.mail.Message.RecipientType type) throws javax.mail.MessagingException
javax.mail.MessagingException
protected abstract javax.activation.DataHandler prepareMail() throws javax.mail.MessagingException
javax.mail.MessagingException
|
Last updated: Do, Dez 9, 2004 12:46 PM CET | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |