Latenode

Automatically store incoming emails in your SQL Server database

This template inserts a Microsoft SQL Server row each time a message hits Mailhook.

Forward or send mail to the Mailhook address, map subject, sender, date, and body in JavaScript, then insert the row. Connect Microsoft SQL Server and put the database password on that connection. This uses inbound email, not a calendar feed.

Updated Sep 16, 2026Est. run: 7sEst. cost: $0.0004
How Latenode estimates time and cost

Latenode bills workflow runtime in CPU seconds. The first 10,000 CPU seconds are free each month, then usage follows pay-as-you-go CPU-second pricing. Plug-and-Play (PnP) AI nodes are billed separately—each PnP token is $1 USD, charged pay-as-you-go at vendor cost plus a small processing fee, with no API keys required.

Full pricing — how CPU seconds work →

Workflow preview

What this template does

  • Logs each inbound email as a SQL Server row
  • Starts when Mailhook receives the message
  • Maps subject, sender, and body in JavaScript
  • Keeps the database password on the SQL Server connection

How it works

1
Trigger

Receive the email

The scenario starts when a message arrives at the Mailhook address.

2
Logic

Map the email fields

JavaScript reads subject, sender, date, and body so each value lines up with a column.

3
Action

Insert the SQL Server row

Microsoft SQL Server inserts those fields into the table you choose.

Setup guide

1

Add Mailhook

Add a Mailhook trigger and copy the inbound address. Forward or send the emails you care about to that address.

2

Connect Microsoft SQL Server

Add a Microsoft SQL Server connection with host, database, user, and password. Use a table with columns for the fields you want to store.

3

Map columns and insert

In JavaScript, return stable field names that match your columns, then insert a row. Send a test email to Mailhook and confirm the new row.

Requirements

Ability to forward or send mail to the Mailhook address
A Microsoft SQL Server table Latenode can write, with credentials on the SQL Server connection
Agreement on which email fields become columns

FAQ

Common questions about this template

Each run uses credits on your Latenode plan. We charge for processing time (1 credit = 30 seconds). Your actual cost depends on your plan and how long the run takes. See pricing plans for plans and how credits work.