Skip to main content

$mail.config

This method configures the settings of the SMTP server that will be used for sending email messages via the $mail.sendMessage method.

Syntax

The method accepts six arguments:

ArgumentTypeDescription
smtpHostStringSMTP server host.
smtpPortNumberSMTP server port.
userStringSMTP server user.
passwordStringSMTP server password.
fromStringEmail sender.
hiddenCopyString or string arrayEmail hidden copy recipient or list of recipients. This argument is optional.
$mail.config(
"smtp.just-ai.com", // Host
2525, // Port
"user@just-ai.com", // User
$secrets.get("smtpPassword"), // Password
"bot@just-ai.com", // Sender
"admin@just-ai.com" // Hidden copy recipient
// ["admin@just-ai.com", "support@just-ai.com"] // List of hidden copy recipients
);
tip
The settings will be used for all subsequent calls to the $mail.sendMessage method, until overridden by another $mail.config call.