Overview
This node sends emails using SMTP protocol. It is useful for automating email notifications, alerts, or any scenario where you want to send customized emails directly from your workflow. For example, you can notify users about a new signup, send reports, or forward messages dynamically based on previous node data.
The node supports sending both plain text and HTML emails, allowing flexibility in formatting. It also supports common email options like CC, BCC, and Reply-To addresses.
Properties
| Name | Meaning |
|---|---|
| To Email | Recipient's email address. Supports expressions to dynamically set the recipient per item. |
| Subject | Subject line of the email. Supports expressions to customize per item. |
| Email Type | Format of the email content: either "Text" (plain text) or "HTML". |
| Message | The email body content. If "Text" is selected, this is plain text; if "HTML", this is HTML code. |
| Options | Additional email options: |
| CC | Carbon copy recipients, comma-separated email addresses. |
| BCC | Blind carbon copy recipients, comma-separated email addresses. |
| Reply To | Reply-to email address. |
Output
The node outputs an array of JSON objects, one per input item processed. Each output object contains:
success: Boolean indicating if the email was sent successfully.messageId: The unique identifier of the sent email message (if successful).response: The raw response from the SMTP server.to: The recipient email address used.subject: The subject line used.error: Present only if sending failed, containing the error message.
No binary data is output by this node.
Dependencies
- Requires an SMTP server configuration with credentials including host, port, username, password, and sender email details.
- Uses the
nodemailerlibrary internally to send emails. - The user must provide valid SMTP credentials via n8n credentials configuration.
- TLS settings are automatically adjusted based on the port used (465 enables secure connection).
Troubleshooting
Common issues:
- Incorrect SMTP credentials or host/port will cause authentication or connection failures.
- Using ports other than 465, 587, or 25 may require custom port configuration.
- Invalid email addresses in To, CC, BCC, or Reply-To fields can cause sending errors.
- Network restrictions or firewalls blocking SMTP ports.
Error messages:
"Failed to send email: <error message>"indicates a failure during sending. Check credentials, network connectivity, and email addresses.- Authentication errors suggest invalid username/password or insufficient permissions.
- Connection timeout or refusal means the SMTP server is unreachable or blocked.
Resolution tips:
- Verify SMTP server details and credentials.
- Ensure the SMTP server allows connections from your environment.
- Validate all email addresses for correct format.
- Use the "Continue On Fail" option to handle errors gracefully in workflows.