Skip to content

mail/client

Documentation

Overview

Classes

MailClient

sendMultipart()

A static convenience method to send a multipart email without instantiating a client. This is suitable for emails that require attachments, inline images, or mixed content.

ts
static sendMultipart(from: string, recipients: any, subject: string, parts: any): void;
ParameterTypeDescription
fromstringThe sender's email address.
recipientsanyThe recipient(s) structure (string for 'to', or MailRecipients object).
subjectstringThe subject line of the email.
partsanyAn array of MailMultipart objects defining the email content.

Returns

  • Type: void
  • Description:

send()

A static convenience method to send a simple email with only a single text or HTML body.

ts
static send(from: string, recipients: any, subject: string, text: string, contentType: MailContentType): void;
ParameterTypeDescription
fromstringThe sender's email address.
recipientsanyThe recipient(s) structure (string for 'to', or MailRecipients object).
subjectstringThe subject line of the email.
textstringThe body content of the email.
contentTypeMailContentTypeSpecifies the body format: 'html' or 'plain'.

Returns

  • Type: void
  • Description:

send()

Sends a simple email with a single body part (text or HTML).

ts
send(from: string, _recipients: any, subject: string, text: string, contentType: MailContentType): void;
ParameterTypeDescription
fromstringThe sender's email address.
_recipientsanyThe recipient(s) structure (string for 'to', or MailRecipients object).
subjectstringThe subject line of the email.
textstringThe body content of the email.
contentTypeMailContentTypeSpecifies the body format: 'html' or 'plain'.

Returns

  • Type: void
  • Description:

sendMultipart()

Sends a complex email composed of multiple parts (text bodies, HTML, attachments, inline content).

ts
sendMultipart(from: string, _recipients: any, subject: string, parts: any): void;
ParameterTypeDescription
fromstringThe sender's email address.
_recipientsanyThe recipient(s) structure (string for 'to', or MailRecipients object).
subjectstringThe subject line of the email.
partsanyAn array of MailMultipart objects defining the email content.

Returns

  • Type: void
  • Description: