public abstract class ERMailDelivery extends Object
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 ...
}
Name | Description |
---|---|
er.javamail.defaultEncoding | er.javamail.defaultEncoding |
Modifier and Type | Field and Description |
---|---|
protected NSMutableArray<ERMailAttachment> |
_attachments
NSArray of ERMailAttachment that must be binded to the message as ATTACHEMENT.
|
String |
_charset |
protected NSMutableArray<ERMailAttachment> |
_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 |
DefaultCharset |
Constructor and Description |
---|
ERMailDelivery()
Default constructor
|
ERMailDelivery(javax.mail.Session session)
Designated constructor
|
Modifier and Type | Method and Description |
---|---|
protected NSMutableArray<ERMailAttachment> |
_attachments() |
protected NSMutableArray<ERMailAttachment> |
_inlineAttachments() |
void |
addAttachment(ERMailAttachment attachment) |
void |
addInlineAttachment(ERMailAttachment attachment) |
NSArray<ERMailAttachment> |
attachments() |
protected ERMessage |
buildMessage()
Builds an ERMessage for the current MimeMessage.
|
String |
charset() |
String |
contextString() |
protected void |
finishMessagePreparation() |
NSArray<ERMailAttachment> |
inlineAttachments() |
protected javax.mail.internet.InternetAddress |
internetAddressWithEmailAndPersonal(String email,
String personal)
メール・アドレスと名前を InternetAddress としてインスタンス化と戻します
|
protected javax.mail.internet.MimeMessage |
mimeMessage() |
void |
newMail()
Creates a new mail instance within ERMailDelivery
ERMailDelivery インスタンス内で新しいメールを作成します。
|
protected abstract 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 |
setAdditionalHeader(String headerKey,
String value)
Sets an additional custom header element for the message.
|
void |
setBCCAddresses(NSArray<String> bccAddresses)
Sets the bcc-addresses array for the current message instance
カレント・メッセージ・インスタンスの BCCアドレス NSArray をセットします
|
void |
setBCCAddresses(NSDictionary<String,String> bccAddresses)
Sets the bcc-addresses array for the current message instance
カレント・メッセージ・インスタンスの BCCアドレス NSDictionary をセットします
|
void |
setCCAddresses(NSArray<String> ccAddresses)
Sets the cc-addresses array for the current message instance
カレント・メッセージ・インスタンスの CCアドレス NSArray をセットします
|
void |
setCCAddresses(NSDictionary<String,String> ccAddresses)
Sets the cc-addresses array for the current message instance
カレント・メッセージ・インスタンスの CCアドレス NSDictionary をセットします
|
void |
setCharset(String charset) |
void |
setContextString(String contextString) |
void |
setDelegate(ERMessage.Delegate delegate)
Sets the given delegate to listen to any messages that are created from this ERMailDelivery.
|
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<javax.mail.internet.InternetAddress> 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 toAddress)
Sets the reply-to address for the current message instance
カレント・メッセージ・インスタンスの Reply To アドレスをセットします
|
void |
setReplyToAddress(String toAddress,
String personalName)
Sets the reply-to address for the current message instance
カレント・メッセージ・インスタンスの Reply To アドレスと名前をセットします
|
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<String> toAddresses)
Sets the to-addresses array for the current message instance
カレント・メッセージ・インスタンスの送信先 NSArray アドレスをセットします
|
void |
setToAddresses(NSDictionary<String,String> toAddresses)
Sets the to-addresses array for the current message instance
カレント・メッセージ・インスタンスの送信先 NSDictionary アドレスをセットします
|
void |
setUserInfo(NSDictionary<String,Object> userInfo)
Sets the userInfo dictionary for this ERMailDelivery.
|
void |
setXMailerHeader(String xMailer)
Sets the X-Mailer header for the message.
|
NSDictionary<String,Object> |
userInfo()
Returns the userInfo dictionary for this ERMailDelivery.
|
String |
xMailerHeader()
Gets the X-Mailer header set on the MimeMessage.
|
protected javax.mail.internet.MimeMessage _mimeMessage
protected NSMutableArray<ERMailAttachment> _attachments
protected NSMutableArray<ERMailAttachment> _inlineAttachments
public static final String DefaultCharset
public String _charset
public ERMailDelivery(javax.mail.Session session)
public ERMailDelivery()
public void setDelegate(ERMessage.Delegate delegate)
delegate
- the delegate to use for notifications
delegate
- - 通知のためのデリゲート
public void setUserInfo(NSDictionary<String,Object> userInfo)
userInfo
- the userInfo dictionary
userInfo
- - ユーザ情報ディクショナリー
public NSDictionary<String,Object> userInfo()
public void setContextString(String contextString)
public String contextString()
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<ERMailAttachment> _inlineAttachments()
public NSArray<ERMailAttachment> inlineAttachments()
protected NSMutableArray<ERMailAttachment> _attachments()
public NSArray<ERMailAttachment> 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
- if parsing of email failedpublic 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<String> toAddresses) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setToAddresses(NSDictionary<String,String> toAddresses) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setReplyToAddress(String toAddress) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setReplyToAddress(String toAddress, String personalName) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setCCAddresses(NSArray<String> ccAddresses) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setCCAddresses(NSDictionary<String,String> ccAddresses) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setBCCAddresses(NSArray<String> bccAddresses) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setBCCAddresses(NSDictionary<String,String> bccAddresses) throws javax.mail.MessagingException, javax.mail.internet.AddressException
javax.mail.MessagingException
javax.mail.internet.AddressException
public void setSubject(String subject) throws javax.mail.MessagingException
subject
- subject stringjavax.mail.MessagingException
- if the charset conversion of the subject failspublic void setXMailerHeader(String xMailer) throws javax.mail.MessagingException
xMailer
- value to set
xMailer
- - セットする値
javax.mail.MessagingException
public String xMailerHeader() throws javax.mail.MessagingException
javax.mail.MessagingException
public void setAdditionalHeader(String headerKey, String value) throws javax.mail.MessagingException
headerKey
- value
- value to setjavax.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.
NSForwardException
にラップされます。
shouldBlock
- - ブロックするかキューを使うかの boolean
protected void finishMessagePreparation() throws javax.mail.MessagingException
javax.mail.MessagingException
public void setInternetAddresses(NSArray<javax.mail.internet.InternetAddress> addresses, javax.mail.Message.RecipientType type) throws javax.mail.MessagingException
javax.mail.MessagingException
protected abstract DataHandler prepareMail() throws javax.mail.MessagingException
javax.mail.MessagingException
Copyright © 2002 – 2020 Project Wonder.