Represents options of the mail client.

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

Hierarchy (View Summary)

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.

sdkOptions?: SDKOptions

Defines whether mails are sent in parallel.

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.

{ rejectUnauthorized: `true` }

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