com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class Attachment

    • Constructor Detail

      • Attachment

        public Attachment(String fileName)

        Initializes a new instance of the Attachment class.

        Parameters:
        fileName - Name of the file.
      • Attachment

        public Attachment(String fileName,
                  String mediaType)

        Initializes a new instance of the Attachment class.

        Parameters:
        fileName - Name of the file.
        mediaType - Type media type name.
      • Attachment

        public Attachment(String fileName,
                  ContentType contentType)

        Initializes a new instance of the Attachment class.

        Parameters:
        fileName - Name of the file.
        contentType - The ContentType.
      • Attachment

        public Attachment(InputStream contentStream,
                  String name)

        Initializes a new instance of the Attachment class.

        Parameters:
        contentStream - The content stream of attachment.
        name - The attachment name.
      • Attachment

        public Attachment(InputStream contentStream,
                  String name,
                  String mediaType)

        Initializes a new instance of the Attachment class.

        Parameters:
        contentStream - The content stream of attachment.
        name - The attachment name.
        mediaType - The media type name.
      • Attachment

        public Attachment(InputStream contentStream,
                  ContentType contentType)

        Initializes a new instance of the Attachment class.

        Parameters:
        contentStream - The content stream of attachment.
        contentType - The ContentType.
    • Method Detail

      • isEmbeddedMessage

        public boolean isEmbeddedMessage()
      • setName

        public void setName(String value)

        Gets or sets an attachment name

        Specified by:
        setName in interface IAttachment
        Parameters:
        value - a String object.
      • getNameEncoding

        public Charset getNameEncoding()

        Gets or sets an encoding of attachment name

      • setNameEncoding

        public void setNameEncoding(Charset value)

        Gets or sets an encoding of attachment name

        Parameters:
        value - a Charset object.
      • getContentDisposition

        public ContentDisposition getContentDisposition()

        Gets Content-Disposition header

      • createAttachmentFromString

        public static Attachment createAttachmentFromString(String content,
                                            String name)

        Creates the attachment from string.

        Parameters:
        content - A string that represents the content of attachment.
        name - The attachment name.
        Returns:
        Returns created attachment
      • createAttachmentFromString

        public static Attachment createAttachmentFromString(String content,
                                            String name,
                                            Charset contentEncoding,
                                            String mediaType)

        Creates the attachment from string.

        Parameters:
        content - A string that represents the content of attachment.
        name - The attachment name.
        contentEncoding - The content encoding.
        mediaType - The media type name
        Returns:
        Returns created attachment
      • createAttachmentFromString

        public static Attachment createAttachmentFromString(String content,
                                            ContentType contentType)

        Creates the attachment from string.

        Parameters:
        content - A string that represents the content of attachment.
        contentType - The ContentType.
        Returns:
        Returns created attachment