### Hierarchy

- EventEmitter
  - SMTPConnection

## Index

### Interfaces

- AuthenticationCredentials
- AuthenticationOAuth2
- AuthenticationTypeLogin
- AuthenticationTypeOAuth2
- Credentials
- DSNOptions
- Envelope
- Options
- SMTPError
- SentMessageInfo

### Type aliases

- AuthenticationType
- DSNOption
- OAuth2

### Constructors

- constructor

### Properties

- _socket
- alreadySecured
- authenticated
- destroyed
- host
- id
- lastServerResponse
- logger
- name
- options
- port
- secure
- secureConnection
- stage
- version
- defaultMaxListeners

### Methods

- addListener
- close
- connect
- emit
- eventNames
- getMaxListeners
- listenerCount
- listeners
- login
- off
- on
- once
- prependListener
- prependOnceListener
- quit
- rawListeners
- removeAllListener
- removeAllListeners
- removeListener
- reset
- send
- setMaxListeners
- listenerCount

## Type aliases

### Static AuthenticationType

AuthenticationType: AuthenticationTypeLogin | AuthenticationTypeOAuth2

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:35

### Static DSNOption

DSNOption: "NEVER" | "SUCCESS" | "FAILURE" | "DELAY"

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:47

### Static OAuth2

OAuth2: Options

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:23

## Constructors

### constructor

- new SMTPConnection(options?: Options): SMTPConnection

- - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:171

  #### Parameters

  - ##### Optional options: Options

  #### Returns SMTPConnection

## Properties

### _socket

_socket: Socket

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:171

The socket connecting to the server

### alreadySecured

alreadySecured: boolean

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:152

### authenticated

authenticated: boolean

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:162

If true, then the user is authenticated

### destroyed

destroyed: boolean

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:164

If set to true, this instance is no longer active

### host

host: string

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:155

### id

id: string

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:148

### lastServerResponse

lastServerResponse: string | false

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:168

### logger

logger: Logger

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:146

### name

name: string

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:157

### options

options: Options

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:144

### port

port: number

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:154

### secure

secure: boolean

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:166

Defines if the current connection is secure or not. If not, STARTTLS can be used if available

### secureConnection

secureConnection: boolean

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:151

### stage

stage: "init" | "connected"

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:149

### version

version: string

- Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:159

Expose version nr, just for the reference

### Static defaultMaxListeners

defaultMaxListeners: number

Inherited from EventEmitter.defaultMaxListeners

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

## Methods

### addListener

- addListener(event: "connect" | "end", listener: function): this
- addListener(event: "error", listener: function): this

- Overrides EventEmitter.addListener

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:188

  #### Parameters

  - ##### event: "connect" | "end"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.addListener

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:189

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: SMTPError): void

      - #### Parameters

        - ##### err: SMTPError

        #### Returns void

  #### Returns this

### close

- close(): void

- - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:180

  Closes the connection to the server

  #### Returns void

### connect

- connect(callback: function): void

- - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:176

  Creates a connection to a SMTP server and sets up connection listener

  #### Parameters

  - ##### callback: function

    - - (err?: SMTPError): void

      - #### Parameters

        - ##### Optional err: SMTPError

        #### Returns void

### emit

- emit(event: "connect" | "end"): boolean
- emit(event: "error", error: Error): boolean

- Overrides EventEmitter.emit

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:191

  #### Parameters

  - ##### event: "connect" | "end"

  #### Returns boolean

- Overrides EventEmitter.emit

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:192

  #### Parameters

  - ##### event: "error"

  - ##### error: Error

  #### 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>

### getMaxListeners

- getMaxListeners(): number

- Inherited from EventEmitter.getMaxListeners

  Overrides EventEmitter.getMaxListeners

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

  #### Returns number

### listenerCount

- listenerCount(event: "connect" | "end" | "error"): number

- Overrides EventEmitter.listenerCount

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:194

  #### Parameters

  - ##### event: "connect" | "end" | "error"

  #### Returns number

### listeners

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

- Overrides EventEmitter.listeners

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:196

  #### Parameters

  - ##### event: "connect" | "end"

  #### Returns Array<function>

- Overrides EventEmitter.listeners

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:197

  #### Parameters

  - ##### event: "error"

  #### Returns Array<function>

### login

- login(auth: AuthenticationCredentials | AuthenticationOAuth2 | Credentials, callback: function): void

- - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:182

  Authenticate user

  #### Parameters

  - ##### auth: AuthenticationCredentials | AuthenticationOAuth2 | Credentials

  - ##### callback: function

    - - (err?: SMTPError): void

      - #### Parameters

        - ##### Optional err: SMTPError

        #### Returns void

### off

- off(event: "connect" | "end", listener: function): this
- off(event: "error", listener: function): this

- Overrides EventEmitter.off

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:199

  #### Parameters

  - ##### event: "connect" | "end"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.off

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:200

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: SMTPError): void

      - #### Parameters

        - ##### err: SMTPError

        #### Returns void

  #### Returns this

### on

- on(event: "connect" | "end", listener: function): this
- on(event: "error", listener: function): this

- Overrides EventEmitter.on

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:202

  #### Parameters

  - ##### event: "connect" | "end"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.on

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:203

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: SMTPError): void

      - #### Parameters

        - ##### err: SMTPError

        #### Returns void

  #### Returns this

### once

- once(event: "connect" | "end", listener: function): this
- once(event: "error", listener: function): this

- Overrides EventEmitter.once

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:205

  #### Parameters

  - ##### event: "connect" | "end"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.once

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:206

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: SMTPError): void

      - #### Parameters

        - ##### err: SMTPError

        #### Returns void

  #### Returns this

### prependListener

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

- Overrides EventEmitter.prependListener

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:208

  #### Parameters

  - ##### event: "connect" | "end"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.prependListener

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:209

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: SMTPError): void

      - #### Parameters

        - ##### err: SMTPError

        #### Returns void

  #### Returns this

### prependOnceListener

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

- Overrides EventEmitter.prependOnceListener

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:211

  #### Parameters

  - ##### event: "connect" | "end"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.prependOnceListener

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:212

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: SMTPError): void

      - #### Parameters

        - ##### err: SMTPError

        #### Returns void

  #### Returns this

### quit

- quit(): void

- - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:178

  Sends QUIT

  #### Returns void

### rawListeners

- rawListeners(event: "connect" | "end"): Array<function>
- rawListeners(event: "error"): Array<function>

- Overrides EventEmitter.rawListeners

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:214

  #### Parameters

  - ##### event: "connect" | "end"

  #### Returns Array<function>

- Overrides EventEmitter.rawListeners

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:215

  #### Parameters

  - ##### event: "error"

  #### Returns Array<function>

### removeAllListener

- removeAllListener(event: "connect" | "end" | "error"): this

- - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:217

  #### Parameters

  - ##### event: "connect" | "end" | "error"

  #### Returns this

### 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: "connect" | "end", listener: function): this
- removeListener(event: "error", listener: function): this

- Overrides EventEmitter.removeListener

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:219

  #### Parameters

  - ##### event: "connect" | "end"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides EventEmitter.removeListener

  - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:220

  #### Parameters

  - ##### event: "error"

  - ##### listener: function

    - - (err: SMTPError): void

      - #### Parameters

        - ##### err: SMTPError

        #### Returns void

  #### Returns this

### reset

- reset(callback: function): void

- - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:186

  Resets connection state

  #### Parameters

  - ##### callback: function

    - - (err?: SMTPError): void

      - #### Parameters

        - ##### Optional err: SMTPError

        #### Returns void

### send

- send(envelope: Envelope, message: string | Buffer | Readable, callback: function): void

- - Defined in node_modules/@types/nodemailer/lib/smtp-connection.d.ts:184

  Sends a message

  #### Parameters

  - ##### envelope: Envelope

  - ##### message: string | Buffer | Readable

  - ##### callback: function

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

      - #### Parameters

        - ##### err: SMTPError | null

        - ##### info: SentMessageInfo

        #### Returns void

### 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

### 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