Send email with Rust

A reqwest POST with a typed response, done. Sending email from Rust skips the SMTP crates entirely.

Verified By Kam Low, Co-founder · Updated

Skip the SMTP crates

lettre is solid if you genuinely need SMTP. But an SMTP crate brings TLS features, connection pools, and builder ceremony to a problem that, for most services, is one HTTP request with serde_json.

One POST, and the send is handled

RustPOST /v1/my/messages
reqwest::Client::new()
  .post("https://api.nitrosend.com/v1/my/messages")
  .bearer_auth(std::env::var("NITROSEND_API_KEY")?)
  .json(&serde_json::json!({
    "from": "[email protected]", "to": "[email protected]",
    "subject": "Welcome", "html": "<p>You're in.</p>"
  }))
  .send().await?;

The ? operator carries your error handling, the response deserializes into whatever type you define, and there is no mail server in your dependency tree.

The platform side moves at a pace Rust people will appreciate: one recent week shipped a rebuilt promptable email builder, five provider integrations, OAuth agent connect, and thirty-plus fixes from live sessions. Fast tools deserve fast infrastructure.

API keys are the server-side story here: a nskey_live_ key lives in your environment and authorizes the whole account, which is why it never belongs in client code.

A craft take Rust minimalists will like, from studying 47 of the best email designs of 2026: plain text outperforms 95 percent of HTML email, and restraint beats complexity every time. The same taste that trims your dependency tree ships better email.

Full parameters, responses, and error codes live in the REST API docs and the API reference.

Python Node.js PHP Go Rust +5
send.py requests ยท stdlib-adjacent
import requests

requests.post(
  "https://api.nitrosend.com/v1/messages",
  headers={"Authorization": f"Bearer {KEY}"},
  json={"to": to, "subject": subj,
        "html": body})
202 ACCEPTED
{ "id": "msg_9f2c",
  "status": "accepted" }

And the part no library gives you

The same account exposes an MCP server, so the agent writing your code can also run your email. Point Claude, Cursor, or Codex at api.nitrosend.com/mcp and it composes, previews, and stages sends, with a human approving every one. The API is for your code. The MCP is for your agent. One platform either way.

Every send comes back with a message ID, and delivery events follow on your webhook: delivered, opened, bounced. No dashboard required to know what happened. If you are staying on SMTP, how to set up SMTP is the setup to follow, and SPF, DKIM and DMARC authentication is what stops those sends landing in spam.

Choosing a mail crate and hand-rolling the SMTP handshake is exactly the kind of work Rust developers are good at skipping when they don't need it. The MCP path is how you skip it here too: point Claude, Cursor, or Codex at our MCP server and the agent composes the send and asks you to approve it, with nothing added to your Cargo.toml. That's where I think email sending is headed, and it's why Nitrosend is a listed app in the ChatGPT app marketplace rather than one more crate claiming a slot in your dependency tree.

Go deeper

Guides

FAQ

How do I send email from Rust?

A reqwest POST with bearer_auth and a serde_json body: from, to, subject, html. Message ID back, delivery events on your webhook, no SMTP crate.

Should I use lettre?

Only when a system you integrate with speaks SMTP and nothing else. For application email, the HTTP path is less code and the platform carries deliverability.

First send in thirty seconds.

Unlimited contacts. Choose your sending volume.

Campaigns, flows and transactional email on every plan. See current prices, included allowances and prepaid services.

Compare plans → · Pricing for agents