Python email API with reliable delivery
Add transactional email to your Python project in minutes using the official Sidemail SDK. Send welcome emails, password resets, receipts, and notifications with a simple API while Sidemail handles infrastructure and deliverability best practices.
Get startedRead API docsfrom sidemail import Sidemail
sidemail = Sidemail()
sidemail.send_email(
toAddress="[email protected]",
fromAddress="[email protected]",
fromName="Your App",
templateName="Welcome",
templateProps={
"firstName": user["name"],
},
)Get Python transactional email delivery live in three steps:
Add Sidemail to your environment with pip:
pip install sidemailCreate a Sidemail client instance. By default, the SDK reads SIDEMAIL_API_KEY from your environment.
from sidemail import Sidemail
import os
sidemail = Sidemail(api_key=os.getenv("SIDEMAIL_API_KEY"))
# or simply: sidemail = Sidemail()Call sidemail.send_email with recipient, sender, and content or template data. Sidemail handles the HTTP request, rendering, and delivery.
# Example: send a welcome email template
sidemail.send_email(
toAddress="[email protected]",
fromAddress="[email protected]",
fromName="Your App",
templateName="Welcome", # template stored in Sidemail
templateProps={"firstName": "Alice"}, # dynamic values for template variables
)Key features & perks
SIDEMAIL_API_KEY, and call one method. Sidemail keeps the integration simple with clear docs and practical examples, so most Python apps are sending in under 30 minutes.Use these production‑style examples to send common transactional emails from Python with Sidemail.
# Python: Send an account verification email template
sidemail.send_email(
toAddress="[email protected]",
fromAddress="[email protected]",
fromName="Your App",
templateName="Email Verification",
templateProps={
"verifyUrl": f"https://yourapp.com/verify?token={token}",
},
)Send a sign‑up verification message with a secure one‑time link or token.
# Python: Send a payment receipt email template
import datetime
sidemail.send_email(
toAddress="[email protected]",
fromAddress="[email protected]",
fromName="Your App",
templateName="Payment Receipt",
templateProps={
"userName": user["name"],
"amount": "$19.99",
"date": datetime.date.today().isoformat(),
},
)Deliver receipts, invoices, and account notifications immediately after important user events.
templateProps to inject values into Sidemail templates while keeping design consistent.# Python: Schedule a welcome email for 1 hour from now
import datetime
scheduled_at = (
datetime.datetime.utcnow() + datetime.timedelta(hours=1)
).isoformat() + "Z"
sidemail.send_email(
toAddress="[email protected]",
fromAddress="[email protected]",
fromName="Your App",
templateName="Welcome",
templateProps={"firstName": "Alex"},
scheduledAt=scheduled_at,
)Queue a welcome email for later delivery, for example one hour after registration.
scheduledAt with a future ISO 8601 timestamp.# Python: Send a password reset email with markdown
with open("templates/emails/password-reset.md", "r", encoding="utf-8") as f:
markdown_content = f.read()
sidemail.send_email(
toAddress="[email protected]",
markdown=markdown_content,
templateProps={
"firstName": "Alex",
"resetLink": "https://yourapp.com/reset?token=abc123xyz",
"expiresIn": "30 minutes",
},
)---
subject: "Reset your password"
fromAddress: "[email protected]"
fromName: "Your App Security"
---
Hi {firstName}, we received a request to reset your password.
[$btn Reset password]({resetLink})
This link expires in {expiresIn}.Write your email in Markdown, then let Sidemail transform it into responsive HTML that matches your project branding and renders consistently across inboxes.
.md file in your Python project.templateProps for dynamic variables like resetLink and expiresIn.Deliverability best practices
SPF and DKIM validate that your messages are authorized by your domain. DMARC adds policy and reporting on top of those checks. Together, these protocols are fundamental for inbox placement and sender trust.
Sidemail helps automate SPF, DKIM, and DMARC setup, so your Python app can send authenticated emails from the start.




The simplest way to build emails
Design responsive templates visually with Sidemail's no‑code editor. Choose brand colors, add your logo, and craft beautiful templates without writing HTML.
Need speed? Start by importing premade email templates for reset emails, welcomes, receipts, and more. Every template is tested for broad email client compatibility, so your Python emails stay clean and consistent.
Learn moreDeveloper‑friendly formatting
Hand‑coding HTML emails can slow down development and create maintenance overhead, especially when your team only needs clear transactional messaging.
With Sidemail, you can write content in Markdown and the platform renders responsive, well‑styled HTML automatically. Headings, lists, buttons, links, and code blocks are supported out of the box.
This workflow is ideal for Python transactional emails, when you want fast authoring, readable templates, and no HTML debugging.
Learn more
Ready to send email in Python with confidence? Sidemail gives you a fast integration, reliable delivery, and ready‑to‑send email templates.
Start free trialInstall Sidemail with pip install sidemail, initialize Sidemail(), and call send_email() with recipient, sender, and content or template data. Sidemail handles the API infrastructure, formatting options, and deliverability workflow.
Yes. The Python SDK works in any Python environment, including Django, Flask, FastAPI, CLI scripts, and background workers.
Create a template in Sidemail, then call send_email() with templateName and templateProps. Sidemail merges dynamic values into your template and sends a fully formatted transactional email.
Yes. Load a markdown file and pass it as markdown in send_email(). Sidemail converts Markdown into responsive HTML email and lets you personalize variables using templateProps.
Yes. Include scheduledAt with a future ISO 8601 timestamp in your send request. Sidemail queues the email and delivers it at the specified time.
Yes. Use Sidemail.file_to_attachment() to build attachment objects from file bytes, then pass them in the attachments array when sending. Keep total attachment size around 2.5 MB or less.
No. Sidemail is API‑first, so you do not need to configure SMTP hosts, ports, or credentials in your Python code. You send email via HTTPS API calls through the SDK, and Sidemail handles the sending.