Creates a new mime tree node. Assumes 'multipart/*' as the content type if it is a branch, anything else counts as leaf. If rootNode is missing from the options, assumes this is the root.

### Hierarchy

- MimeNode

## Index

### Interfaces

- Addresses
- Envelope
- Options

### Constructors

- constructor

### Methods

- addHeader
- appendChild
- build
- buildHeaders
- createChild
- createReadStream
- getAddresses
- getEnvelope
- getHeader
- getTransferEncoding
- processFunc
- remove
- replace
- setContent
- setEnvelope
- setHeader
- setRaw
- stream
- transform

## Constructors

### constructor

- new MimeNode(contentType: string, options?: Options): MimeNode

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:48

  #### Parameters

  - ##### contentType: string

  - ##### Optional options: Options

  #### Returns MimeNode

## Methods

### addHeader

- addHeader(key: string, value: string): this
- addHeader(headers: object | Array<object>): this

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:77

  Adds a header value. If the value for selected key exists, the value is appended as a new field and old one is not touched. You can set multiple values as well by using [{key:'', value:''}] or {key: 'value'} as the first argument.

  #### Parameters

  - ##### key: string

  - ##### value: string

  #### Returns this

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:78

  #### Parameters

  - ##### headers: object | Array<object>

  #### Returns this

### appendChild

- appendChild(childNode: MimeNode): MimeNode

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:55

  Appends an existing node to the mime tree. Removes the node from an existing tree if needed

  #### Parameters

  - ##### childNode: MimeNode

  #### Returns MimeNode

### build

- build(callback: function): void

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:91

  Generate the message and return it with a callback

  #### Parameters

  - ##### callback: function

    - - (err: Error | null, buf: Buffer): void

      - #### Parameters

        - ##### err: Error | null

        - ##### buf: Buffer

        #### Returns void

### buildHeaders

- buildHeaders(): string

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:96

  Builds the header block for the mime node. Append \r\n\r\n before writing the content

  #### Returns string

### createChild

- createChild(contentType: string, options?: Options): MimeNode

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:52

  Creates and appends a child node.Arguments provided are passed to MimeNode constructor

  #### Parameters

  - ##### contentType: string

  - ##### Optional options: Options

  #### Returns MimeNode

### createReadStream

- createReadStream(options?: ReadableOptions): Readable

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:102

  Streams the rfc2822 message from the current node. If this is a root node, mandatory header fields are set if missing (Date, Message-Id, MIME-Version)

  #### Parameters

  - ##### Optional options: ReadableOptions

  #### Returns Readable

### getAddresses

- getAddresses(): Addresses

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:124

  Generates and returns an object with parsed address fields

  #### Returns Addresses

### getEnvelope

- getEnvelope(): Envelope

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:127

  Generates and returns SMTP envelope with the sender address and a list of recipients addresses

  #### Returns Envelope

### getHeader

- getHeader(key: string): string

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:81

  Retrieves the first mathcing value of a selected key

  #### Parameters

  - ##### key: string

  #### Returns string

### getTransferEncoding

- getTransferEncoding(): string

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:93

  #### Returns string

### processFunc

- processFunc(processFunc: function): void

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:116

  Appends a post process function. The functon is run after transforms and uses the following syntax

  processFunc(input) -> outputStream

  #### Parameters

  - ##### processFunc: function

    - - (outputStream: Readable): Readable

      - #### Parameters

        - ##### outputStream: Readable

        #### Returns Readable

  #### Returns void

### remove

- remove(): this

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:61

  Removes current node from the mime tree

  #### Returns this

### replace

- replace(node: MimeNode): MimeNode

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:58

  Replaces current node with another node

  #### Parameters

  - ##### node: MimeNode

  #### Returns MimeNode

### setContent

- setContent(content: string | Buffer | Readable): this

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:88

  Sets body content for current node. If the value is a string, charset is added automatically to Content-Type (if it is text/*). If the value is a Buffer, you need to specify the charset yourself

  #### Parameters

  - ##### content: string | Buffer | Readable

  #### Returns this

### setEnvelope

- setEnvelope(envelope: Envelope): this

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:121

  Sets envelope to be used instead of the generated one

  #### Parameters

  - ##### envelope: Envelope

  #### Returns this

### setHeader

- setHeader(key: string, value: string | string[]): this
- setHeader(headers: object | Array<object>): this

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:68

  Sets a header value. If the value for selected key exists, it is overwritten. You can set multiple values as well by using [{key:'', value:''}] or {key: 'value'} as the first argument.

  #### Parameters

  - ##### key: string

  - ##### value: string | string[]

  #### Returns this

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:69

  #### Parameters

  - ##### headers: object | Array<object>

  #### Returns this

### setRaw

- setRaw(raw: string | Buffer | Readable): this

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:130

  Sets pregenerated content that will be used as the output of this node

  #### Parameters

  - ##### raw: string | Buffer | Readable

  #### Returns this

### stream

- stream(outputStream: Readable, options: ReadableOptions, done: function): void

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:118

  #### Parameters

  - ##### outputStream: Readable

  - ##### options: ReadableOptions

  - ##### done: function

    - - (err?: Error | null): void

      - #### Parameters

        - ##### Optional err: Error | null

        #### Returns void

### transform

- transform(transform: Transform): void

- - Defined in node_modules/@types/nodemailer/lib/mime-node.d.ts:108

  Appends a transform stream object to the transforms list. Final output is passed through this stream before exposing

  #### Parameters

  - ##### transform: Transform

  #### Returns void

Generated using TypeDoc