Home/Email API/Languages & frameworks

Send email programmatically, in any language

Sending email programmatically means your code sends the email: a confirmation, an alert, a receipt, with no human drafting anything. One REST call does it from any language that can make an HTTP request.

Verified By George Hartley, Co-founder · Updated July 20, 2026

What it means to send email programmatically

Your application sends the email. A signup fires a confirmation, a payment fires a receipt, a failure fires an alert. No inbox, no compose window, no human in the middle. The code makes an authenticated request and delivery is handled.

There are two ways to do it, and one of them is why this page exists.

SMTP vs the API path

The old path is SMTP: smtplib in Python, Nodemailer in Node, JavaMail in Java. You configure a host, pick port 587 or 465, generate an app password for Gmail, and hold a connection open. Every language has its own library and every library has its own way of failing.

The API path is one HTTP POST. No SMTP library, no ports, no app passwords, no connection management. You get a message ID back, and delivery events after that.

The SMTP way
smtp.host = ? port 587? 465? app password STARTTLS retry logic connection pool
Hours of setup. Silent failures.
The API way
POST api.nitrosend.com/v1/messages
{ to, subject, html }
Delivered
One request. Same call in every language.
The Gmail trap, since half the tutorials go there: sending your app's email through a Gmail account means app passwords that expire, security alerts, and a daily cap built for a person, not a product. Gmail is a mailbox. Production email needs a sending platform behind it.

I've been doing email for a decade and my companies have sent over 6 billion emails. Almost none of the pain in that decade came from the send itself. It came from everything wrapped around it. The API path deletes most of the wrapping.

And the wrapping is where the speed lives now. In one week we shipped a rebuilt visual email builder that Claude and Codex can prompt, five provider integrations, OAuth agent connect, and thirty-plus fixes from live user sessions. A protocol from 1982 was never going to keep that pace.

One call, any language

PythonPOST /v1/my/messages
import requests

requests.post(
  "https://api.nitrosend.com/v1/my/messages",
  headers={"Authorization": "Bearer $NITROSEND_API_KEY"},
  json={
    "from": "[email protected]",
    "to": "[email protected]",
    "subject": "Welcome",
    "html": "<p>You're in.</p>",
  },
)

Swap requests for fetch, curl_init, Net::HTTP, HttpClient, or reqwest and the call is the same. Bearer token, JSON body, message ID back. That is the whole contract, in every language we cover.

One field note from running the receiving end: Cloudflare's WAF blocks the default Python-urllib user agent, so a bare urllib script gets a cryptic 403 with error code 1010 while the identical call through requests sails through. Set a real User-Agent and move on. We learned to watch for this the interesting way: an audit of our own traffic turned up 3,228 tool calls with a blank user agent, almost all of them OAuth requests from Codex, which sends no User-Agent at all.

My take: the language guides are where most providers hide their worst docs. Ours are the first thing agents read, so they have to be exact.

Pick your language

One POST. Any language.

Simple pricing. Unlimited contacts.

Every plan includes full stack emailing: Flows, Newsletter Campaigns and Transactional Email, plus our NitroWheel LLM and all agent integrations (Claude, ChatGPT, Codex, Cursor and others). Pay for what you send, not who you store.

Free
$0
forever
  • Emails 8,000then 500/mo
  • Email types Transactional & Marketing
  • AI actions 20/mo
  • Contacts Free & Unlimited
  • Brands 1
  • Seats 1
Start free
Ultra
$100
per month
  • Emails 125,000/month
  • AI actions 5,000/mo
  • Brands 5
  • Seats 10 · Domains 3
  • Frontier AI Included
  • Dedicated IP Available
Get started
Enterprise
$300
per month
  • AI actions Unlimited
  • Unlimited brands & domains Included
  • SSO / SAML Included
  • 99.9% SLA Included
Get started

Free forever. No credit card required. See full comparison →