Represents options for setting up the SMTP connection. This interface is compatible with SMTPConnection.Options of nodemailer.

interface SmtpTransportOptions {
    connection?: Socket;
    connectionTimeout?: number;
    debug?: boolean;
    greetingTimeout?: number;
    ignoreTLS?: boolean;
    logger?: boolean;
    opportunisticTLS?: boolean;
    proxy?: string;
    requireTLS?: boolean;
    secure?: boolean;
    socket?: Socket;
    socketTimeout?: number;
    tls?: ConnectionOptions;
}

Hierarchy (view full)

Properties

connection?: Socket

Connected socket to use instead of creating and connecting a new one. If secure option is true, then socket is upgraded from plain text to cipher text.

connectionTimeout?: number

How many milliseconds to wait for the connection to establish.

debug?: boolean

If set to true, then logs SMTP traffic and message content, otherwise logs only transaction events.

greetingTimeout?: number

How many milliseconds to wait for the greeting after connection is established.

ignoreTLS?: boolean

Turns off STARTTLS support if true.

logger?: boolean

If set to true then logs to console. If value is not set or is false then nothing is logged.

opportunisticTLS?: boolean

Tries to use STARTTLS and continues normally if it fails.

proxy?: string

A proxy URL used for connecting the SMTP server. This value will be forwarded to the underlying nodemailer lib, so it handles the proxy job for the SDK.

requireTLS?: boolean

Forces the client to use STARTTLS. Returns an error if upgrading the connection is not possible or fails.

secure?: boolean

Defines if the connection should use SSL (if true) or not (if false).

socket?: Socket

Initialized socket to use instead of creating a new one.

socketTimeout?: number

How many milliseconds of inactivity to allow.

tls?: ConnectionOptions

Defines additional options to be passed to the socket constructor.

Example

{ rejectUnauthorized: `true` }

Copyright Ⓒ 2024 SAP SE or an SAP affiliate company. All rights reserved.