Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SEND MAIL

Send email messages.

Syntax

SEND MAIL to, subject, body
SEND MAIL to, subject, body USING "account@example.com"

Parameters

ParameterTypeDescription
toStringRecipient email address(es), comma-separated for multiple
subjectStringEmail subject line
bodyStringEmail body (plain text or HTML)
accountString(Optional) Connected account to send through

Description

The SEND MAIL keyword sends emails using either:

  1. Default SMTP - Configuration from config.csv
  2. Connected Account - Send through Gmail, Outlook, etc. configured in Sources app

Configuration

Default SMTP in config.csv:

name,value
email-from,noreply@example.com
email-server,smtp.example.com
email-port,587
email-user,smtp-user@example.com
email-pass,smtp-password

Examples

SEND MAIL "user@example.com", "Welcome!", "Thank you for signing up."
recipients = "john@example.com, jane@example.com"
SEND MAIL recipients, "Team Update", "Meeting tomorrow at 3 PM"
body = "<h1>Welcome!</h1><p>Thank you for joining us.</p>"
SEND MAIL "user@example.com", "Getting Started", body

USING Clause

Send through a connected account configured in Suite → Sources → Accounts:

SEND MAIL "customer@example.com", "Subject", body USING "support@company.com"

The email appears from that account’s address with proper authentication.

SEND MAIL "customer@example.com", "Ticket Update", "Your ticket has been resolved." USING "support@company.com"

Delivery Status

status = SEND MAIL "user@example.com", "Test", "Message"
IF status = "sent" THEN
    TALK "Email delivered successfully"
END IF

Best Practices

  1. Use connected accounts for better deliverability
  2. Validate email addresses before sending
  3. Implement delays for bulk emails
  4. Handle failures gracefully

Troubleshooting

IssueCauseSolution
Auth failedInvalid credentialsCheck config.csv or re-authenticate account
Not sendingFirewall blockingVerify port 587/465 is open
Going to spamNo domain authConfigure SPF/DKIM
Account not foundNot configuredAdd account in Suite → Sources

See Also

Implementation

Located in src/basic/keywords/send_mail.rs