Creates an object for exposing the Mail API

### Hierarchy

- EventEmitter
  - Mail

## Index

### Interfaces

- Address
- Attachment
- AttachmentLike
- Connection
- Envelope
- IcalAttachment
- ListHeaders
- Options

### Type aliases

- Headers
- ListHeader
- PluginFunction
- TextEncoding

### Constructors

- constructor

### Properties

- MailMessage
- dkim
- logger
- meta
- options
- transporter
- defaultMaxListeners

### Methods

- addListener
- close
- emit
- eventNames
- get
- getMaxListeners
- getVersionString
- isIdle
- listenerCount
- listeners
- off
- on
- once
- prependListener
- prependOnceListener
- rawListeners
- removeAllListeners
- removeListener
- sendMail
- set
- setMaxListeners
- setupProxy
- use
- verify
- listenerCount

## Type aliases

### Static Headers

Headers: object | Array<object>

- Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:18

### Static ListHeader

ListHeader: string | object

- Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:20

### Static PluginFunction

PluginFunction: function

- Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:142

#### Type declaration

- - (mail: MailMessage, callback: function): void

  - #### Parameters

    - ##### mail: MailMessage

    - ##### callback: function

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

        - #### Parameters

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

          #### Returns void

### Static TextEncoding

TextEncoding: "quoted-printable" | "base64"

- Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:26

## Constructors

### constructor

- new Mail(transporter: Transport, options: TransportOptions, defaults: TransportOptions): Mail

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:154

  #### Parameters

  - ##### transporter: Transport

  - ##### options: TransportOptions

  - ##### defaults: TransportOptions

  #### Returns Mail

## Properties

### MailMessage

MailMessage: MailMessage

- Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:154

Usage: typeof transporter.MailMessage

### dkim

dkim: DKIM

- Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:149

### logger

logger: Logger

- Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:151

### meta

meta: Map<string, any>

- Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:148

### options

options: Options

- Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:147

### transporter

transporter: Transport

- Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:150

### Static defaultMaxListeners

defaultMaxListeners: number

Inherited from EventEmitter.defaultMaxListeners

- Defined in node_modules/@types/node/events.d.ts:8

## Methods

### addListener

- addListener(event: "error", listener: function): this
- addListener(event: "idle", listener: function): this
- addListener(event: "token", listener: function): this

- Overrides EventEmitter.addListener

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:187

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: Error): void

      - #### Parameters

        - ##### err: Error

        #### Returns void

  #### Returns this

- Overrides EventEmitter.addListener

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:188

  #### Parameters

  - ##### event: "idle"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.addListener

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:189

  #### Parameters

  - ##### event: "token"

  - ##### listener: function

    - - (token: Token): void

      - #### Parameters

        - ##### token: Token

        #### Returns void

  #### Returns this

### close

- close(): void

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:159

  Closes all connections in the pool. If there is a message being sent, the connection is closed later

  #### Returns void

### emit

- emit(event: "error", error: Error): boolean
- emit(event: "idle"): boolean
- emit(event: "token", token: Token): boolean

- Overrides EventEmitter.emit

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:191

  #### Parameters

  - ##### event: "error"

  - ##### error: Error

  #### Returns boolean

- Overrides EventEmitter.emit

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:192

  #### Parameters

  - ##### event: "idle"

  #### Returns boolean

- Overrides EventEmitter.emit

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:193

  #### Parameters

  - ##### event: "token"

  - ##### token: Token

  #### Returns boolean

### eventNames

- eventNames(): Array<string | symbol>

- Inherited from EventEmitter.eventNames

  Overrides EventEmitter.eventNames

  - Defined in node_modules/@types/node/events.d.ts:23

  #### Returns Array<string | symbol>

### get

- get(key: "oauth2_provision_cb"): function
- get(key: "proxy_handler_http" | "proxy_handler_https" | "proxy_handler_socks" | "proxy_handler_socks5" | "proxy_handler_socks4" | "proxy_handler_socks4a"): function
- get(key: string): any

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:183

  #### Parameters

  - ##### key: "oauth2_provision_cb"

  #### Returns function

  - - (user: string, renew: boolean, callback: function): void

    - #### Parameters

      - ##### user: string

      - ##### renew: boolean

      - ##### callback: function

        - - (err: Error | null, accessToken: string, expires: number): void

          - #### Parameters

            - ##### err: Error | null

            - ##### accessToken: string

            - ##### expires: number

            #### Returns void

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:184

  #### Parameters

  - ##### key: "proxy_handler_http" | "proxy_handler_https" | "proxy_handler_socks" | "proxy_handler_socks5" | "proxy_handler_socks4" | "proxy_handler_socks4a"

  #### Returns function

  - - (proxy: Url, options: TransportOptions, callback: function): void

    - #### Parameters

      - ##### proxy: Url

      - ##### options: TransportOptions

      - ##### callback: function

        - - (err: Error | null, socketOptions: object): void

          - #### Parameters

            - ##### err: Error | null

            - ##### socketOptions: object

              - ##### connection: Socket

            #### Returns void

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:185

  #### Parameters

  - ##### key: string

  #### Returns any

### getMaxListeners

- getMaxListeners(): number

- Inherited from EventEmitter.getMaxListeners

  Overrides EventEmitter.getMaxListeners

  - Defined in node_modules/@types/node/events.d.ts:19

  #### Returns number

### getVersionString

- getVersionString(): string

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:174

  #### Returns string

### isIdle

- isIdle(): boolean

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:162

  Returns true if there are free slots in the queue

  #### Returns boolean

### listenerCount

- listenerCount(type: string | symbol): number

- Inherited from EventEmitter.listenerCount

  Overrides EventEmitter.listenerCount

  - Defined in node_modules/@types/node/events.d.ts:24

  #### Parameters

  - ##### type: string | symbol

  #### Returns number

### listeners

- listeners(event: "error"): Array<function>
- listeners(event: "idle"): Array<function>
- listeners(event: "end"): Array<function>

- Overrides EventEmitter.listeners

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:211

  #### Parameters

  - ##### event: "error"

  #### Returns Array<function>

- Overrides EventEmitter.listeners

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:212

  #### Parameters

  - ##### event: "idle"

  #### Returns Array<function>

- Overrides EventEmitter.listeners

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:213

  #### Parameters

  - ##### event: "end"

  #### Returns Array<function>

### off

- off(event: string | symbol, listener: function): this

- Inherited from EventEmitter.off

  Overrides EventEmitter.off

  - Defined in node_modules/@types/node/events.d.ts:16

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: function

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### on

- on(event: "error", listener: function): this
- on(event: "idle", listener: function): this
- on(event: "token", listener: function): this

- Overrides EventEmitter.on

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:195

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: Error): void

      - #### Parameters

        - ##### err: Error

        #### Returns void

  #### Returns this

- Overrides EventEmitter.on

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:196

  #### Parameters

  - ##### event: "idle"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.on

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:197

  #### Parameters

  - ##### event: "token"

  - ##### listener: function

    - - (token: Token): void

      - #### Parameters

        - ##### token: Token

        #### Returns void

  #### Returns this

### once

- once(event: "error", listener: function): this
- once(event: "idle", listener: function): this
- once(event: "token", listener: function): this

- Overrides EventEmitter.once

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:199

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: Error): void

      - #### Parameters

        - ##### err: Error

        #### Returns void

  #### Returns this

- Overrides EventEmitter.once

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:200

  #### Parameters

  - ##### event: "idle"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.once

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:201

  #### Parameters

  - ##### event: "token"

  - ##### listener: function

    - - (token: Token): void

      - #### Parameters

        - ##### token: Token

        #### Returns void

  #### Returns this

### prependListener

- prependListener(event: "error", listener: function): this
- prependListener(event: "idle", listener: function): this
- prependListener(event: "end", listener: function): this

- Overrides EventEmitter.prependListener

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:203

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: Error): void

      - #### Parameters

        - ##### err: Error

        #### Returns void

  #### Returns this

- Overrides EventEmitter.prependListener

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:204

  #### Parameters

  - ##### event: "idle"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.prependListener

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:205

  #### Parameters

  - ##### event: "end"

  - ##### listener: function

    - - (token: Token): void

      - #### Parameters

        - ##### token: Token

        #### Returns void

  #### Returns this

### prependOnceListener

- prependOnceListener(event: "error", listener: function): this
- prependOnceListener(event: "idle", listener: function): this
- prependOnceListener(event: "end", listener: function): this

- Overrides EventEmitter.prependOnceListener

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:207

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: Error): void

      - #### Parameters

        - ##### err: Error

        #### Returns void

  #### Returns this

- Overrides EventEmitter.prependOnceListener

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:208

  #### Parameters

  - ##### event: "idle"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.prependOnceListener

  - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:209

  #### Parameters

  - ##### event: "end"

  - ##### listener: function

    - - (token: Token): void

      - #### Parameters

        - ##### token: Token

        #### Returns void

  #### Returns this

### rawListeners

- rawListeners(event: string | symbol): Function[]

- Inherited from EventEmitter.rawListeners

  Overrides EventEmitter.rawListeners

  - Defined in node_modules/@types/node/events.d.ts:21

  #### Parameters

  - ##### event: string | symbol

  #### Returns Function[]

### removeAllListeners

- removeAllListeners(event?: string | symbol): this

- Inherited from EventEmitter.removeAllListeners

  Overrides EventEmitter.removeAllListeners

  - Defined in node_modules/@types/node/events.d.ts:17

  #### Parameters

  - ##### Optional event: string | symbol

  #### Returns this

### removeListener

- removeListener(event: string | symbol, listener: function): this

- Inherited from EventEmitter.removeListener

  Overrides EventEmitter.removeListener

  - Defined in node_modules/@types/node/events.d.ts:15

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: function

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### sendMail

- sendMail(mailOptions: Options, callback: function): void
- sendMail(mailOptions: Options): Promise<SentMessageInfo>

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:171

  Sends an email using the preselected transport object

  #### Parameters

  - ##### mailOptions: Options

  - ##### callback: function

    - - (err: Error | null, info: SentMessageInfo): void

      - #### Parameters

        - ##### err: Error | null

        - ##### info: SentMessageInfo

        #### Returns void

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:172

  #### Parameters

  - ##### mailOptions: Options

  #### Returns Promise<SentMessageInfo>

### set

- set(key: "oauth2_provision_cb", value: function): Map<string, any>
- set(key: "proxy_handler_http" | "proxy_handler_https" | "proxy_handler_socks" | "proxy_handler_socks5" | "proxy_handler_socks4" | "proxy_handler_socks4a", value: function): Map<string, any>
- set(key: string, value: any): Map<string, any>

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:179

  #### Parameters

  - ##### key: "oauth2_provision_cb"

  - ##### value: function

    - - (user: string, renew: boolean, callback: function): void

      - #### Parameters

        - ##### user: string

        - ##### renew: boolean

        - ##### callback: function

          - - (err: Error | null, accessToken?: undefined | string, expires?: undefined | number): void

            - #### Parameters

              - ##### err: Error | null

              - ##### Optional accessToken: undefined | string

              - ##### Optional expires: undefined | number

              #### Returns void

  #### Returns Map<string, any>

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:180

  #### Parameters

  - ##### key: "proxy_handler_http" | "proxy_handler_https" | "proxy_handler_socks" | "proxy_handler_socks5" | "proxy_handler_socks4" | "proxy_handler_socks4a"

  - ##### value: function

    - - (proxy: Url, options: TransportOptions, callback: function): void

      - #### Parameters

        - ##### proxy: Url

        - ##### options: TransportOptions

        - ##### callback: function

          - - (err: Error | null, socketOptions?: undefined | object): void

            - #### Parameters

              - ##### err: Error | null

              - ##### Optional socketOptions: undefined | object

              #### Returns void

  #### Returns Map<string, any>

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:181

  #### Parameters

  - ##### key: string

  - ##### value: any

  #### Returns Map<string, any>

### setMaxListeners

- setMaxListeners(n: number): this

- Inherited from EventEmitter.setMaxListeners

  Overrides EventEmitter.setMaxListeners

  - Defined in node_modules/@types/node/events.d.ts:18

  #### Parameters

  - ##### n: number

  #### Returns this

### setupProxy

- setupProxy(proxyUrl: string): void

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:177

  Sets up proxy handler for a Nodemailer object

  #### Parameters

  - ##### proxyUrl: string

  #### Returns void

### use

- use(step: string, plugin: PluginFunction): this

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:168

  #### Parameters

  - ##### step: string

  - ##### plugin: PluginFunction

  #### Returns this

### verify

- verify(callback: function): void
- verify(): Promise<true>

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:165

  Verifies SMTP configuration

  #### Parameters

  - ##### callback: function

    - - (err: Error | null, success: true): void

      - #### Parameters

        - ##### err: Error | null

        - ##### success: true

        #### Returns void

- - Defined in node_modules/@types/nodemailer/lib/mailer/index.d.ts:166

  #### Returns Promise<true>

### Static listenerCount

- listenerCount(emitter: EventEmitter, event: string | symbol): number

- Inherited from EventEmitter.listenerCount

  - Defined in node_modules/@types/node/events.d.ts:7
  deprecated

    since v4.0.0

  #### Parameters

  - ##### emitter: EventEmitter

  - ##### event: string | symbol

  #### Returns number

Generated using TypeDoc