Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MailAttachment

Represent a mail attachment that can be used in a MailMessage.

Hierarchy

  • MailAttachment

Index

Methods

addHeader

  • Add an header to this attachment.

    Parameters

    • key: string
    • value: string

    Returns MailAttachment

getContentId

  • getContentId(): string
  • get the Content-ID field

    Returns string

getContentType

  • getContentType(): string
  • get the Content-Type

    Returns string

getData

  • getData(): Buffer
  • get the data

    Returns Buffer

getDescription

  • getDescription(): string
  • get the description field

    Returns string

getDisposition

  • getDisposition(): string
  • get the disposition field

    Returns string

getHeaders

  • getHeaders(): MultiMap
  • Get the headers to be added for this attachment.

    Returns MultiMap

getName

  • getName(): string
  • get the name

    Returns string

getSize

  • getSize(): number
  • Gets the size of the attachment.

    Returns number

getStream

  • getStream(): ReadStream<Buffer>
  • Gets the data stream.

    Returns ReadStream<Buffer>

setContentId

  • set the Content-ID field to be used in the attachment

    Parameters

    • contentId: string

    Returns MailAttachment

setContentType

  • set the Content-Type

    Parameters

    • contentType: string

    Returns MailAttachment

setData

  • set the data

    Parameters

    • data: Buffer

    Returns MailAttachment

setDescription

  • set the description field to be used in the attachment

    Parameters

    • description: string

    Returns MailAttachment

setDisposition

  • set the disposition field to be used in the attachment

    Parameters

    • disposition: string

    Returns MailAttachment

setHeaders

  • Set the headers to be added for this attachment.

    Parameters

    • headers: MultiMap

    Returns MailAttachment

setName

  • set the name

    Parameters

    • name: string

    Returns MailAttachment

setSize

  • Sets the size of the attachment.

    It is needed when using ReadStream for the MailAttachement.

    Parameters

    • size: number

    Returns MailAttachment

setStream

  • Sets the data stream.

    Parameters

    • stream: ReadStream<Buffer>

    Returns MailAttachment

toJson

  • toJson(): {}
  • convert this object to JSON representation

    Returns {}

    • [key: string]: any

Static create

  • construct an empty MailAttachment object that can be filled with the setters

    Returns MailAttachment

  • create a MailAttachment object from a JsonObject representation

    Parameters

    • json: {}
      • [key: string]: any

    Returns MailAttachment

  • create a copy of a MailAttachment object

    Parameters

    Returns MailAttachment

Generated using TypeDoc