The SMTP block sends email through any standard SMTP mail server, including Gmail, Outlook, and self-hosted or custom mail servers. It connects directly using the server hostname, port, and credentials you provide rather than a vendor-specific API.
With the SMTP block, you can:
- Connect to any SMTP server: Configure host, port, and security protocol (TLS, SSL, or none) for the mail server of your choice
- Control message content and formatting: Set sender, recipients, subject, and body, with support for either plain text or HTML content
- Reach multiple recipients and attach files: Add CC and BCC recipients, set a reply-to address, and attach files to the outgoing email
In Sim, the SMTP block allows your agents to send emails as part of a workflow by supplying connection details and message content, then confirming delivery through the returned success status and message ID. This makes it possible to notify recipients, deliver generated reports, or trigger email-based alerts directly from a workflow, with the block reporting the message ID on success or an error message if sending fails.
Usage Instructions
Send emails using any SMTP server (Gmail, Outlook, custom servers, etc.). Configure SMTP connection settings and send emails with full control over content, recipients, and attachments.
Actions
smtp_send_mail
Send emails via SMTP server
Input
| Parameter | Type | Required | Description |
|---|---|---|---|
smtpHost | string | Yes | SMTP server hostname (e.g., smtp.gmail.com) |
smtpPort | number | Yes | SMTP server port (587 for TLS, 465 for SSL) |
smtpUsername | string | Yes | SMTP authentication username |
smtpPassword | string | Yes | SMTP authentication password |
smtpSecure | string | Yes | Security protocol (TLS, SSL, or None) |
from | string | Yes | Sender email address |
to | string | Yes | Recipient email address |
subject | string | Yes | Email subject |
body | string | Yes | Email body content |
contentType | string | No | Content type (text or html) |
fromName | string | No | Display name for sender |
cc | string | No | CC recipients (comma-separated) |
bcc | string | No | BCC recipients (comma-separated) |
replyTo | string | No | Reply-to email address |
attachments | file[] | No | Files to attach to the email |
Output
| Parameter | Type | Description |
|---|---|---|
success | boolean | Whether the email was sent successfully |
messageId | string | Message ID from SMTP server |
to | string | Recipient email address |
subject | string | Email subject |
error | string | Error message if sending failed |