Send email notifications from n8n using the Send Email node with SMTP credentials or the Gmail node with OAuth. Configure the SMTP host, port, username, and password in n8n credentials, then connect the Send Email node to any workflow to send alerts, reports, or notifications when specific events occur.
Why Send Email Notifications from n8n
Email is the most reliable notification channel for workflow automation. Whether you need to alert your team when a workflow fails, send daily reports, or notify customers about order status changes, n8n provides dedicated email nodes. The Send Email node works with any SMTP server including Gmail, Outlook, SendGrid, and Amazon SES. For Gmail specifically, the Gmail node uses OAuth for simpler setup. Both approaches let you send HTML emails with dynamic content pulled from your workflow data.
Prerequisites
- A running n8n instance (self-hosted or n8n Cloud)
- SMTP server credentials (host, port, username, password) or a Gmail account
- A workflow that produces data you want to send via email
- For Gmail: OAuth credentials from Google Cloud Console (or use n8n Cloud's built-in OAuth)
Step-by-step guide
Create SMTP credentials in n8n
Create SMTP credentials in n8n
Before adding the email node, set up your SMTP credentials. Go to the n8n editor, click the gear icon for Settings, then select Credentials. Click Add Credential and search for SMTP. Fill in your SMTP server details: host, port, username, and password. Common SMTP configurations include Gmail (smtp.gmail.com, port 465, SSL), Outlook (smtp.office365.com, port 587, STARTTLS), and SendGrid (smtp.sendgrid.net, port 587). For Gmail, you need an App Password if two-factor authentication is enabled.
1// SMTP credential configuration examples23// Gmail SMTP4// Host: smtp.gmail.com5// Port: 4656// SSL/TLS: true7// User: your-email@gmail.com8// Password: your-app-password (not your regular password)910// Outlook SMTP11// Host: smtp.office365.com12// Port: 58713// STARTTLS: true14// User: your-email@outlook.com15// Password: your-password1617// SendGrid SMTP18// Host: smtp.sendgrid.net19// Port: 58720// User: apikey21// Password: your-sendgrid-api-keyExpected result: SMTP credentials are saved in n8n and available for use in Send Email nodes.
Add the Send Email node to your workflow
Add the Send Email node to your workflow
In your workflow, click the plus button and search for Send Email. Add it to your canvas and connect it to the node that produces the data you want to email. Open the node settings and select the SMTP credential you created in the previous step. Fill in the From Email, To Email, Subject, and Body fields. You can use static text or n8n expressions to insert dynamic data from previous nodes.
1// Send Email node configuration2// Credential: Select your SMTP credential3// From Email: notifications@yourcompany.com4// To Email: {{ $json.recipientEmail }}5// Subject: Workflow Report — {{ $now.toFormat('yyyy-MM-dd') }}6// Body (Text):7// Hello {{ $json.name }},8// Your report is ready. Total records processed: {{ $json.count }}.Expected result: The Send Email node is configured and connected to your workflow. It will send an email with dynamic content when executed.
Send HTML-formatted emails
Send HTML-formatted emails
For professional-looking emails, switch from plain text to HTML in the Send Email node. Toggle the HTML option and write your email body in HTML. You can include tables, formatting, colors, and links. Use n8n expressions inside the HTML to inject dynamic data. This is ideal for sending reports, dashboards, or formatted notifications to stakeholders.
1<!-- HTML email body with dynamic n8n expressions -->2<html>3<body style="font-family: Arial, sans-serif; padding: 20px;">4 <h2 style="color: #333;">Daily Workflow Report</h2>5 <p>Hello {{ $json.name }},</p>6 <p>Here is your daily summary for {{ $now.toFormat('MMMM dd, yyyy') }}:</p>7 <table style="border-collapse: collapse; width: 100%;">8 <tr style="background-color: #f2f2f2;">9 <th style="padding: 8px; border: 1px solid #ddd;">Metric</th>10 <th style="padding: 8px; border: 1px solid #ddd;">Value</th>11 </tr>12 <tr>13 <td style="padding: 8px; border: 1px solid #ddd;">Records Processed</td>14 <td style="padding: 8px; border: 1px solid #ddd;">{{ $json.recordCount }}</td>15 </tr>16 <tr>17 <td style="padding: 8px; border: 1px solid #ddd;">Errors</td>18 <td style="padding: 8px; border: 1px solid #ddd;">{{ $json.errorCount }}</td>19 </tr>20 </table>21 <p style="color: #666; margin-top: 20px;">This report was generated automatically by n8n.</p>22</body>23</html>Expected result: The email arrives in the recipient's inbox with formatted HTML content including a styled table with dynamic data.
Use the Gmail node with OAuth (alternative)
Use the Gmail node with OAuth (alternative)
If you use Gmail, the Gmail node provides a simpler setup using OAuth instead of SMTP credentials. Add the Gmail node, click Create New Credential, and follow the OAuth flow to connect your Google account. The Gmail node supports sending, reading, and labeling emails. It also supports attachments and threaded replies. This is often easier than configuring SMTP because you do not need App Passwords.
1// Gmail node configuration2// Operation: Send3// To: {{ $json.recipientEmail }}4// Subject: Alert — {{ $json.alertType }}5// Message: {{ $json.alertMessage }}6// 7// Optional settings:8// CC: team@yourcompany.com9// BCC: logs@yourcompany.com10// Attachments: connect a binary field from a previous nodeExpected result: The Gmail node sends emails through your connected Google account using OAuth. No SMTP configuration is needed.
Add error notification to any workflow
Add error notification to any workflow
A common pattern is to send an email when a workflow fails. Use the Error Trigger node as the start of a separate error-handling workflow. The Error Trigger fires whenever any workflow in your n8n instance encounters an error. Connect it to a Send Email node to receive instant notifications about failures, including the workflow name, error message, and execution ID.
1// Error notification workflow2// Node 1: Error Trigger (fires on any workflow error)3// Node 2: Send Email4// To: admin@yourcompany.com5// Subject: n8n Workflow Error — {{ $json.workflow.name }}6// Body:7// Workflow: {{ $json.workflow.name }}8// Error: {{ $json.execution.error.message }}9// Execution ID: {{ $json.execution.id }}10// Time: {{ $now.toISO() }}11// View: https://n8n.example.com/execution/{{ $json.execution.id }}Expected result: Whenever any workflow fails, you receive an email with the workflow name, error message, and a link to the failed execution.
Complete working example
1{2 "name": "Email Error Notifications",3 "nodes": [4 {5 "parameters": {},6 "name": "Error Trigger",7 "type": "n8n-nodes-base.errorTrigger",8 "typeVersion": 1,9 "position": [250, 300]10 },11 {12 "parameters": {13 "fromEmail": "n8n@yourcompany.com",14 "toEmail": "admin@yourcompany.com",15 "subject": "=n8n Error: {{ $json.workflow.name }}",16 "html": true,17 "text": "<html><body style='font-family: Arial;'><h2 style='color: #e74c3c;'>Workflow Error</h2><p><strong>Workflow:</strong> {{ $json.workflow.name }}</p><p><strong>Error:</strong> {{ $json.execution.error.message }}</p><p><strong>Execution ID:</strong> {{ $json.execution.id }}</p><p><strong>Time:</strong> {{ $now.toFormat('yyyy-MM-dd HH:mm:ss') }}</p><hr><p style='color:#888;'>Sent automatically by n8n error monitoring.</p></body></html>"18 },19 "name": "Send Error Email",20 "type": "n8n-nodes-base.emailSend",21 "typeVersion": 2,22 "position": [470, 300],23 "credentials": {24 "smtp": {25 "id": "1",26 "name": "SMTP Account"27 }28 }29 }30 ],31 "connections": {32 "Error Trigger": {33 "main": [34 [{"node": "Send Error Email", "type": "main", "index": 0}]35 ]36 }37 }38}Common mistakes when sending Email Notifications in n8n
Why it's a problem: Using your Gmail password instead of an App Password with two-factor authentication enabled
How to avoid: Go to myaccount.google.com > Security > App Passwords and generate a password specifically for n8n. Use that in the SMTP credentials.
Why it's a problem: Sending emails in a loop without rate limiting
How to avoid: Use the SplitInBatches node to process recipients in batches with a delay between batches. Most SMTP servers have rate limits.
Why it's a problem: Forgetting to enable SSL/TLS in the SMTP credential configuration
How to avoid: Enable SSL for port 465 or STARTTLS for port 587. Without encryption, most SMTP servers reject the connection.
Why it's a problem: Not testing with the Execute Workflow button before activating
How to avoid: Always send a test email manually first. Check the To address, Subject, and Body for correct dynamic content before activating the workflow.
Best practices
- Use App Passwords for Gmail SMTP instead of your main account password
- Set up a dedicated error notification workflow to catch failures across all workflows
- Use HTML email bodies for reports and formatted notifications
- Store SMTP credentials in n8n's credential manager, never hardcode them in nodes
- Test email sending with the Execute Workflow button before activating the workflow
- Add CC or BCC for team visibility on critical notifications
- Use SendGrid or Amazon SES for high-volume email sending instead of personal SMTP accounts
- Include the execution ID in error emails so you can quickly find the failed execution in the history
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I want to send email notifications from my n8n workflow whenever a new order is created. Show me how to configure the Send Email node with SMTP credentials and dynamic content from the order data.
Help me set up an error notification workflow in n8n that sends an HTML email with the workflow name and error details whenever any workflow fails.
Frequently asked questions
Can I send emails with attachments in n8n?
Yes. The Send Email node supports attachments via binary data. Connect a node that produces binary output (like Read Binary File or HTTP Request) before the Send Email node. In the attachments field, reference the binary property name.
Which SMTP port should I use?
Use port 465 with SSL/TLS for encrypted connections, or port 587 with STARTTLS. Port 25 is unencrypted and blocked by most providers. Check your email provider's documentation for the recommended port.
Can I send to multiple recipients in one Send Email node?
Yes. In the To field, enter multiple email addresses separated by commas. You can also use CC and BCC fields for additional recipients.
Why is my Gmail SMTP connection being rejected?
Gmail requires either an App Password (if two-factor authentication is enabled) or Less Secure App Access (deprecated). Generate an App Password at myaccount.google.com > Security > App Passwords.
Can I use the Gmail node on a self-hosted n8n instance?
Yes, but you need to create OAuth credentials in Google Cloud Console and configure them in n8n. On n8n Cloud, Google OAuth is pre-configured for easier setup.
How do I send emails only when certain conditions are met?
Add an IF node before the Send Email node. Configure conditions to check the data, like error count greater than zero or status equals failed. Only items passing the condition will flow to the Send Email node.
Can RapidDev help me set up automated email workflows in n8n?
Yes. RapidDev can build production-ready email notification systems in n8n including error alerting, report generation, and customer communication workflows. Contact RapidDev for a free consultation.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation