Minimal setup & reliable delivery
Add email sending to your Flask app in under 30 minutes with Sidemail's official Python SDK and developer‑friendly API. Sidemail takes care of deliverability, SPF/DKIM/DMARC, templates, and infrastructure so your Flask routes can send emails fast and reliably.
Get startedRead API docsfrom flask import Flask, request, jsonify
from sidemail_client import sidemail
app = Flask(__name__)
@app.post("/register")
def register():
data = request.get_json()
# ... create user in database
sidemail.send_email(
to_address=data["email"],
from_address="[email protected]",
from_name="Your App",
template_name="Welcome",
template_props={"firstName": data["name"]},
)
return jsonify({"status": "registered"})Start sending emails from your Flask app in three steps:
Add Sidemail to your Flask project via pip:
pip install sidemailCreate a sidemail_client.py module and initialize the Sidemail client. The SDK reads SIDEMAIL_API_KEY from your environment automatically.
# sidemail_client.py
from sidemail import Sidemail
sidemail = Sidemail()Import the client and call send_email. Pass the recipient, sender, and template or content. That's it.
from flask import request, jsonify
from sidemail_client import sidemail
@app.post("/register")
def register():
data = request.get_json()
# ... create user in database
sidemail.send_email(
to_address=data["email"],
from_address="[email protected]",
from_name="Your App",
template_name="Welcome",
template_props={"firstName": data["name"]},
)
return jsonify({"status": "registered"})Key features & perks
With Sidemail, you can send any transactional email from Flask. Here are a few examples with code:
# Flask: Send an account verification email
from flask import request, jsonify
from sidemail_client import sidemail
@app.post("/register")
def register():
data = request.get_json()
# ... create user, generate token
sidemail.send_email(
to_address=data["email"],
from_address="[email protected]",
from_name="Your App",
template_name="Email Verification",
template_props={
"verifyUrl": f"https://yourapp.com/verify?token={token}",
},
)
return jsonify({"status": "registered"})Send a sign-up verification email with a one-time link or code to confirm the user's address.
# Flask: Send a payment receipt email
from datetime import date
from sidemail_client import sidemail
sidemail.send_email(
to_address=user["email"],
from_address="[email protected]",
from_name="Your App",
template_name="Payment Receipt",
template_props={
"userName": user["name"],
"amount": "$19.99",
"date": date.today().strftime("%b %d, %Y"),
},
)Send a receipt, invoice, or generic notification to your user.
template_props to populate Sidemail's receipt and invoice templates.# Flask: Schedule a welcome email for 1 hour from now
from datetime import datetime, timedelta, timezone
from sidemail_client import sidemail
scheduled_time = datetime.now(timezone.utc) + timedelta(hours=1)
sidemail.send_email(
to_address="[email protected]",
from_address="[email protected]",
from_name="Your App",
template_name="Welcome",
template_props={"firstName": "Alex"},
scheduled_at=scheduled_time.isoformat(),
)Schedule a welcome email to be delivered later, for example one hour after sign-up.
scheduled_at field with an ISO timestamp to control exactly when the email is sent.# Flask: Send a password reset email with Markdown
from pathlib import Path
from sidemail_client import sidemail
markdown = Path("templates/emails/password-reset.md").read_text()
sidemail.send_email(
to_address="[email protected]",
markdown=markdown,
template_props={
"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}.Sidemail's API gives you the option to write email content in Markdown, which is automatically transformed into pixel‑perfect, responsive emails that look great in every inbox and on every device. Each email is branded with your logo and styled to match your project's email design.
.md file in your Flask templates foldertemplate_props(such as resetLink and expiresIn), which map directly to variables in your markdown.Deliverability best practices
SPF and DKIM are authentication protocols that verify your emails are legitimately sent from your domain. And DMARC builds on both by instructing mail servers how to handle messages that fail those checks. Together, they are 3 critical factors for inbox delivery and sender reputation.
Sidemail automatically handles SPF, DKIM, and DMARC setup for you, so your Flask app sends authenticated, best‑practice‑compliant emails from the start.




The simplest way to build emails
Sidemail's no‑code email editor is the quickest way to create responsive email templates that render correctly across every client and device. No HTML knowledge needed. Add your logo and brand colors, and you're ready to send.
Need to move faster? Sidemail includes a library of production‑ready templates for the most common use cases – password resets, welcome emails, receipts, and more. Build from scratch or customize a premade template — we guarantee your emails look great everywhere.
Learn moreDeveloper‑friendly formatting
Writing and maintaining HTML emails by hand is tedious, especially when you just want to send clean, readable content.
Sidemail lets you write your email body in Markdown and automatically converts it into a responsive, well‑styled HTML email. You get smart formatting – headings, lists, links, and code blocks – without worrying about broken layouts or cross‑client rendering issues.
Ideal for transactional emails sent from your Flask app – clean content, fast authoring, and zero HTML to debug.
Learn more
Ready to send transactional emails from your Flask app? With Sidemail's email API and premade templates, you can integrate in under 30 minutes and deliver emails reliably.
Start free trialThe easiest way to send email from a Flask app is by using an email API like Sidemail. Install the Python SDK (pip install sidemail), create a shared client module, and call sidemail.send_email() from any route. No SMTP setup or Flask-Mail extension needed. Sidemail handles authentication, formatting, and deliverability for you.
No. Sidemail's Python SDK makes direct API calls, so you don't need Flask-Mail or any SMTP server. A single pip install and your API key are all that's required. You get template support, scheduling, delivery tracking, and high deliverability built in — features Flask-Mail doesn't provide.
Instead of building email HTML with Jinja2, use Sidemail's template system. In the Sidemail dashboard, pick a premade template or build one with the drag‑and‑drop editor. In your Flask route, reference the template by template_name and pass dynamic data via template_props. Sidemail merges the data and sends a well‑formatted email.
Yes. Since Sidemail is a plain Python module, you can import it into any Blueprint. Just import the shared client from sidemail_client and call send_email() in any route handler, regardless of which Blueprint it belongs to. No Flask app context coupling required.
Sidemail's API responds fast (typically under 200ms), so synchronous calls work well for most routes. If you need non-blocking delivery, call send_email() from a Celery task or RQ job. Alternatively, use Sidemail's scheduled_at field to queue the email for future delivery without a task queue on your end.
Wrap your sidemail.send_email() call in a try/except block and catch sidemail.SidemailError. The exception includes the HTTP status code, error type, and a human-readable message. Log it with Python's logging module and return an appropriate response to the client.