Use this advanced n8n workflow to send emails from custom Gmail aliases with optional attachments by directly interacting with the Gmail API. Essential for robust programmatic emailing.
Download this n8n workflow template and start using it instantly.
This powerful n8n workflow addresses the limitations encountered when utilizing the standard Gmail n8n node for advanced use cases, specifically when defining custom 'From' aliases or handling complex, programmatic attachments. By utilizing the Gmail API directly through an advanced HTTP Request n8n node, this n8n automation provides granular control over the email payload. This allows users to reliably define the sender name, reply-to address, and seamlessly attach files downloaded from external URLs, all while maintaining the integrity of the base64-encoded MIME structure. This is an essential n8n workflow for high-volume or highly customized email delivery.
The entire process begins with the Webhook Trigger, which serves as the entry point for the n8n workflow, typically receiving a POST request containing all email configuration data (recipient, subject, body, and potentially an array of attachment URLs). The flow first determines if attachments are provided using the If Attachments n8n node, checking the file_urls property in the incoming body. If URLs exist, the Split Out Attachments node separates them, allowing the Download Attachments n8n node (an HTTP Request) to fetch the binary data for each file. All required data then flows into the core component: the Format Email Payload n8n node (a Code node). This crucial step validates input, processes all binary data found in the previous nodes into a list of attachments, and programmatically constructs the complete MIME message in the RFC2822 standard. This message, which includes the HTML body and base64-encoded attachments, is then base64url encoded, which is the specific format required by the Gmail API. Finally, the Send Gmail as Alias HTTP Request n8n node executes the POST call to the Gmail API using OAuth2 credentials, successfully delivering the email from the specified custom alias. This comprehensive n8n node chain ensures robust email delivery.
Webhook Trigger n8n node is configured with the path /send-gmail-as-alias. Activate the n8n workflow and copy the full production webhook URL.Send Gmail as Alias n8n node (HTTP Request), ensure you select or create an OAuth2 credential for Gmail. This credential must be authorized to use the gmail.send scope and must belong to an account that has permission to send emails from the desired custom alias. Note that sending from an alias requires proper configuration within your Gmail settings.toEmail, subject, htmlBody, and optionally, file_urls (an array of public file URLs for attachments)./send-gmail-as-alias to initiate the n8n workflow execution.file_urls to determine if the attachment download path should be taken.messages/send endpoint, leveraging OAuth2 credentials and the raw parameter to send the meticulously constructed, base64url encoded email payload, enabling the use of custom aliases.Use this powerful n8n workflow to instantly convert Obsidian notes into professional emails via Gmail. Features attachment processing, YAML metadata parsing, and instant confirmation responses.

Automate daily server health checks using this n8n workflow. Run SSH commands, check for upgradable packages, and send instant email notifications via SMTP if updates are detected.

Use this custom n8n workflow to schedule and automatically send a beautifully formatted daily weather report directly to your email using the OpenWeatherMap API and the Gmail n8n node.

Analyze Google Analytics data weekly using an n8n workflow. Extract page engagement, search console, and country data, utilize OpenRouter AI for SEO insights, and save reports to Baserow. Get started with n8n templates.

Use this n8n workflow to automatically monitor a list of URLs on a set schedule. This n8n template uses core n8n nodes like Schedule Trigger and HTTP Request for effective DevOps monitoring.

Use this robust n8n workflow to automatically fetch hourly 24h Binance data for major coins (BTC, ETH, SOL), analyze volatility, momentum, and bid-ask spread, and send detailed HTML market reports to Telegram. An essential n8n template for traders.









































