程序包 com.sh.mail.core

类 MultiPartEmail

java.lang.Object
com.sh.mail.core.Email
com.sh.mail.core.MultiPartEmail
直接已知子类:
HtmlEmail

public class MultiPartEmail extends Email

Description: This class is used to send multi-part internet email like messages with attachments.

Title:首亨软件 - TSS/CRM等

从以下版本开始:
Aug 13, 2012
  • 构造器详细资料

    • MultiPartEmail

      public MultiPartEmail()
  • 方法详细资料

    • setSubType

      public void setSubType(String aSubType)
      Set the MIME subtype of the email.
      参数:
      aSubType - MIME subtype of the email
      从以下版本开始:
      1.0
    • getSubType

      public String getSubType()
      Get the MIME subtype of the email.
      返回:
      MIME subtype of the email
      从以下版本开始:
      1.0
    • addPart

      public Email addPart(String partContent, String partContentType) throws EmailException
      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

      public Email addPart(jakarta.mail.internet.MimeMultipart multipart) throws EmailException
      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

      public Email setMsg(String msg) throws EmailException
      Set the message of the email.
      指定者:
      setMsg 在类中 Email
      参数:
      msg - A String.
      返回:
      An Email.
      抛出:
      EmailException - see javax.mail.internet.MimeBodyPart for definitions
      从以下版本开始:
      1.0
    • buildMimeMessage

      public void buildMimeMessage() throws EmailException
      Builds the actual MimeMessage
      覆盖:
      buildMimeMessage 在类中 Email
      抛出:
      EmailException - see javax.mail.internet.MimeBodyPart for definitions
      从以下版本开始:
      1.0
    • attach

      public MultiPartEmail attach(EmailAttachment attachment) throws EmailException
      Attach an EmailAttachment.
      参数:
      attachment - An EmailAttachment.
      返回:
      A MultiPartEmail.
      抛出:
      EmailException - see javax.mail.internet.MimeBodyPart for definitions
      从以下版本开始:
      1.0
    • attach

      public MultiPartEmail attach(URL url, String name, String description) throws EmailException
      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.MessagingException
      Gets 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