Home/Email API/Send via Outlook

Python send email via Outlook

Microsoft retired basic SMTP auth for Microsoft 365, and every Python-Outlook tutorial older than that is broken. Your code shouldn't have to chase their auth roadmap.

Verified By Kam Low, Co-founder · Updated July 20, 2026

Why the old tutorials stopped working

The classic recipe, smtplib against smtp.office365.com with a username and password, died when Microsoft switched 365 tenants off basic authentication. The replacement is OAuth 2.0 token flows against Microsoft Graph or SMTP with modern auth: app registrations, client secrets, tenant IDs, token refresh.

That is a lot of Azure ceremony to send a notification.

Let your code stop caring about Microsoft's auth

The email API path removes the moving part: your Python authenticates to one stable endpoint with a bearer token, and the platform's infrastructure handles delivery to Outlook, Gmail, and everyone else.

PythonPOST /v1/my/messages
requests.post(
  "https://api.nitrosend.com/v1/my/messages",
  headers={"Authorization": "Bearer $NITROSEND_API_KEY"},
  json={"from": "[email protected]", "to": "[email protected]",
        "subject": "Your report", "html": "<p>Attached below.</p>"},
)

Reaching Outlook inboxes then becomes a deliverability question, SPF, DKIM, DMARC on your domain, which the platform configures for you.

And it's worth respecting the scale of the gatekeepers. Apple, Alphabet, and Microsoft now control 77 percent of the world's inbox market between them. You don't out-clever three trillion-dollar filters. You authenticate properly and send mail people want.

Outlook's own rules are concrete: past 5,000 emails a day, Microsoft requires SPF, DKIM, and DMARC aligned, with a DMARC policy of p=quarantine or stronger. Switching providers also buys you a short adjustment window while Outlook and Gmail get used to your mail arriving from a new place, so judge deliverability after the warm-up, not on day one. One more count worth knowing: for all of Outlook's enterprise presence, Microsoft 365 mailboxes are only around 5 percent of where senders' audiences actually live. Gmail dominates. Weight your testing accordingly.

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

The trap
Gmail app password
abcd efgh ijkl mnop
✕ 500 emails/day cap
✕ breaks when 2FA settings change
✕ a full-inbox credential in your code
The fix
POST /v1/messages
Authorization: Bearer ns_live_…
✓ scoped API key, revoke anytime
✓ 8,000 free sends, no daily cliff
✓ delivery events you can act on

Go deeper

Gmail version of the same trap: Python via Gmail. The full language guide: send email with Python. Outlook applies its own filtering, so SPF, DKIM and DMARC authentication matters here, and inbox placement is how you tell whether it worked.

First send in thirty seconds.

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.

Plan limits are ceilings, not guaranteed immediate send headroom; only mature, clean volume sent through that exact sender can raise its capacity.

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

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