MailMessage#
Required: to, subject. Optional: text, html, from, cc, bcc, replyTo, attachments, priority, headers.
MailRecipient is either a string or MailAddress ({ name?, address }). MailAttachment can contain content or path, plus filename/content type/content ID/encoding metadata.
IMailer#
A transport implements:
interface IMailer {
sendMail(message: MailMessage): Promise<void>;
}Register a custom transport under CUSTOM_MAILER and select it with MAIL_TRANSPORT=custom. The transport owns delivery mechanics; domain-specific message content belongs in the calling application or package facade.
Built-in helpers#
The root entry point exports sendMail, sendVerifyEmail, sendResetPassword, sendRecoveryCode and send2FACode. Treat codes as secrets: never log them or include them in analytics.