Mail client
Mail client · Type
Properties
Section titled “Properties”| Name | Type | Description |
|---|---|---|
description | string | |
logger | ||
namespace | string |
Methods
Section titled “Methods”client
Section titled “client”client.client(dsn: string) → Client
Create an SMTP client from a DSN string. The DSN’s host is checked the way mash.http checks a URL: no internal or reserved address unless an administrator allowed it.
client.from(senderAddress: string, senderDisplay?: string) → Client
Set the sender address and display name.
message
Section titled “message”client.message(options?: array = []) → Message
Create a new email message.
parser
Section titled “parser”client.parser(file: File)
Parse an email file (EML/MIME)
client.send(recipient: mixed, subject: mixed, body: mixed, attachments?: mixed = [], cc?: mixed = [], bcc?: mixed = [], replyTo?: mixed = [], delay?: int)
Send an email.
sendMessage
Section titled “sendMessage”client.sendMessage(message: Message, delay?: int)
Send a pre-built message object.
sendWithTemplate
Section titled “sendWithTemplate”client.sendWithTemplate(template: mixed, recipient: mixed, subject: string, data: array, attachments?: mixed = [], cc?: mixed = [], bcc?: mixed = [], replyTo?: mixed = [], delay?: int)
Send an email using a notification template.
template
Section titled “template”client.template(template: mixed) → TemplateModel
Get a notification template by name, ID, or UUID.
templates
Section titled “templates”client.templates() → TemplateModel[]
List this tenant’s notification templates.