程序包 com.sh.mail.core
类 MultiPartEmail
java.lang.Object
com.sh.mail.core.Email
com.sh.mail.core.MultiPartEmail
- 直接已知子类:
HtmlEmail
Description: This class is used to send multi-part internet email like messages with attachments.
Title:首亨软件 - TSS/CRM等
- 从以下版本开始:
- Aug 13, 2012
-
字段概要
从类继承的字段 com.sh.mail.core.Email
ATTACHMENTS, authenticator, bccList, bounceAddress, ccList, charset, content, CONTENT_TYPE, contentType, debug, EMAIL_BODY, EMAIL_SUBJECT, emailBody, FILE_SERVER, fromAddress, headers, hostName, ISO_8859_1, KOI8_R, MAIL_DEBUG, MAIL_HOST, MAIL_PORT, MAIL_SMTP_AUTH, MAIL_SMTP_CONNECTIONTIMEOUT, MAIL_SMTP_FROM, MAIL_SMTP_PASSWORD, MAIL_SMTP_SOCKET_FACTORY_CLASS, MAIL_SMTP_SOCKET_FACTORY_FALLBACK, MAIL_SMTP_SOCKET_FACTORY_PORT, MAIL_SMTP_TIMEOUT, MAIL_SMTP_USER, MAIL_TRANSPORT_PROTOCOL, MAIL_TRANSPORT_TLS, message, popBeforeSmtp, popHost, popPassword, popUsername, RECEIVER_EMAIL, RECEIVER_NAME, replyList, SENDER_EMAIL, SENDER_NAME, sentDate, SMTP, smtpPort, socketConnectionTimeout, socketTimeout, ssl, sslSmtpPort, subject, TEXT_HTML, TEXT_PLAIN, tls, toList, US_ASCII -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明addPart(jakarta.mail.internet.MimeMultipart multipart) Add a new part to the email.addPart(jakarta.mail.internet.MimeMultipart multipart, int index) Add a new part to the email.Add a new part to the email.attach(EmailAttachment attachment) Attach an EmailAttachment.Attach a file specified as a DataSource interface.Attach a file specified as a DataSource interface.Attach a file located by its URL.Attach a file located by its URL.voidBuilds the actual MimeMessageprotected jakarta.mail.BodyPartCreates a body part object.protected jakarta.mail.internet.MimeMultipartCreates a mime multipart object.protected jakarta.mail.internet.MimeMultipartGets the message container.protected jakarta.mail.BodyPartGets first body part of the message.Get the MIME subtype of the email.protected voidinit()Initialize the multipart email.booleanChecks whether there are attachments.protected booleanChecks if this object is initialized.voidsetBoolHasAttachments(boolean b) Sets whether there are attachments.protected voidsetInitialized(boolean b) Sets the initialized status of this object.Set the message of the email.voidsetSubType(String aSubType) Set the MIME subtype of the email.从类继承的方法 com.sh.mail.core.Email
addBcc, addBcc, addBcc, addCc, addCc, addCc, addHeader, addReplyTo, addReplyTo, addReplyTo, addTo, addTo, addTo, createMimeMessage, getBccAddresses, getCcAddresses, getFromAddress, getHostName, getMailSession, getMimeMessage, getReplyToAddresses, getSentDate, getSmtpPort, getSocketConnectionTimeout, getSocketTimeout, getSslSmtpPort, getSubject, getToAddresses, isSSL, isTLS, resetToAddress, send, sendMimeMessage, setAuthentication, setAuthenticator, setBcc, setBounceAddress, setCc, setCharset, setContent, setContent, setDebug, setFrom, setFrom, setFrom, setHeaders, setHostName, setMailSession, setMailSessionFromJNDI, setPopBeforeSmtp, setReplyTo, setSentDate, setSmtpPort, setSocketConnectionTimeout, setSocketTimeout, setSSL, setSslSmtpPort, setSubject, setTLS, setTo, toInternetAddressArray, updateContentType
-
构造器详细资料
-
MultiPartEmail
public MultiPartEmail()
-
-
方法详细资料
-
setSubType
Set the MIME subtype of the email.- 参数:
aSubType- MIME subtype of the email- 从以下版本开始:
- 1.0
-
getSubType
Get the MIME subtype of the email.- 返回:
- MIME subtype of the email
- 从以下版本开始:
- 1.0
-
addPart
Add a new part to the email.- 参数:
partContent- The content.partContentType- The content type.- 返回:
- An Email.
- 抛出:
EmailException- see javax.mail.internet.MimeBodyPart for definitions- 从以下版本开始:
- 1.0
-
addPart
Add a new part to the email.- 参数:
multipart- The MimeMultipart.- 返回:
- An Email.
- 抛出:
EmailException- see javax.mail.internet.MimeBodyPart for definitions- 从以下版本开始:
- 1.0
-
addPart
public Email addPart(jakarta.mail.internet.MimeMultipart multipart, int index) throws EmailException Add a new part to the email.- 参数:
multipart- The part to add.index- The index to add at.- 返回:
- The email.
- 抛出:
EmailException- An error occured while adding the part.- 从以下版本开始:
- 1.0
-
init
protected void init()Initialize the multipart email.- 从以下版本开始:
- 1.0
-
setMsg
Set the message of the email.- 指定者:
setMsg在类中Email- 参数:
msg- A String.- 返回:
- An Email.
- 抛出:
EmailException- see javax.mail.internet.MimeBodyPart for definitions- 从以下版本开始:
- 1.0
-
buildMimeMessage
Builds the actual MimeMessage- 覆盖:
buildMimeMessage在类中Email- 抛出:
EmailException- see javax.mail.internet.MimeBodyPart for definitions- 从以下版本开始:
- 1.0
-
attach
Attach an EmailAttachment.- 参数:
attachment- An EmailAttachment.- 返回:
- A MultiPartEmail.
- 抛出:
EmailException- see javax.mail.internet.MimeBodyPart for definitions- 从以下版本开始:
- 1.0
-
attach
Attach a file located by its URL. The disposition of the file is set to mixed.- 参数:
url- The URL of the file (may be any valid URL).name- The name field for the attachment.description- A description for the attachment.- 返回:
- A MultiPartEmail.
- 抛出:
EmailException- see javax.mail.internet.MimeBodyPart for definitions- 从以下版本开始:
- 1.0
-
attach
public MultiPartEmail attach(URL url, String name, String description, String disposition) throws EmailException Attach a file located by its URL.- 参数:
url- The URL of the file (may be any valid URL).name- The name field for the attachment.description- A description for the attachment.disposition- Either mixed or inline.- 返回:
- A MultiPartEmail.
- 抛出:
EmailException- see javax.mail.internet.MimeBodyPart for definitions- 从以下版本开始:
- 1.0
-
attach
public MultiPartEmail attach(jakarta.activation.DataSource ds, String name, String description) throws EmailException Attach a file specified as a DataSource interface.- 参数:
ds- A DataSource interface for the file.name- The name field for the attachment.description- A description for the attachment.- 返回:
- A MultiPartEmail.
- 抛出:
EmailException- see javax.mail.internet.MimeBodyPart for definitions- 从以下版本开始:
- 1.0
-
attach
public MultiPartEmail attach(jakarta.activation.DataSource ds, String name, String description, String disposition) throws EmailException Attach a file specified as a DataSource interface.- 参数:
ds- A DataSource interface for the file.name- The name field for the attachment.description- A description for the attachment.disposition- Either mixed or inline.- 返回:
- A MultiPartEmail.
- 抛出:
EmailException- see javax.mail.internet.MimeBodyPart for definitions- 从以下版本开始:
- 1.0
-
getPrimaryBodyPart
protected jakarta.mail.BodyPart getPrimaryBodyPart() throws jakarta.mail.MessagingExceptionGets first body part of the message.- 返回:
- The primary body part.
- 抛出:
jakarta.mail.MessagingException- An error occured while getting the primary body part.- 从以下版本开始:
- 1.0
-
getContainer
protected jakarta.mail.internet.MimeMultipart getContainer()Gets the message container.- 返回:
- The message container.
- 从以下版本开始:
- 1.0
-
createBodyPart
protected jakarta.mail.BodyPart createBodyPart()Creates a body part object. Can be overridden if you don't want to create a BodyPart.- 返回:
- the created body part
-
createMimeMultipart
protected jakarta.mail.internet.MimeMultipart createMimeMultipart()Creates a mime multipart object.- 返回:
- the created mime part
-
isBoolHasAttachments
public boolean isBoolHasAttachments()Checks whether there are attachments.- 返回:
- true if there are attachments
- 从以下版本开始:
- 1.0
-
setBoolHasAttachments
public void setBoolHasAttachments(boolean b) Sets whether there are attachments.- 参数:
b- the attachments flag- 从以下版本开始:
- 1.0
-
isInitialized
protected boolean isInitialized()Checks if this object is initialized.- 返回:
- true if initialized
-
setInitialized
protected void setInitialized(boolean b) Sets the initialized status of this object.- 参数:
b- the initialized status flag
-