Back to blog
Engineering10 min readMarch 8, 2026

AstroMail vs Mailgun vs SendGrid: How We Handle Email

Email is the backbone of every service business. Transactional notifications, marketing campaigns, investor updates, client onboarding sequences. If your email does not work, your business does not work.

Most platforms outsource email to Mailgun, SendGrid, or Amazon SES. It is the path of least resistance. But it comes with trade-offs that most founders do not think about until it is too late.

The Third-Party Problem

When you send email through Mailgun or SendGrid, you are sharing IP reputation with every other customer on that platform. One bad actor on a shared IP can tank your deliverability overnight. You have limited control over DKIM, SPF, and DMARC configuration. And you are paying per email, which adds up fast at scale.

SendGrid charges $19.95/month for 50,000 emails. Mailgun charges $35/month for the same. At 200,000 emails per month, you are looking at $89 to $150 per month just for transactional email. Add marketing campaigns and the bill climbs further.

The AstroMail Architecture

AstroMail is our self-hosted email solution built on Stalwart Mail Server, deployed on EasyPanel. Every Ai Engine tenant gets their own dedicated sending domain with properly configured SPF, DKIM, and DMARC records.

The architecture is straightforward. Stalwart handles SMTP, IMAP, and JMAP protocols. We run it behind a reverse proxy with TLS termination. Each tenant's DNS is configured with the appropriate records during onboarding, which takes about 5 minutes.

Deliverability

Because each tenant has their own dedicated domain and IP reputation, one client's sending behavior does not affect another's. We monitor bounce rates, spam complaints, and engagement metrics per tenant. If a domain starts trending in the wrong direction, we catch it early.

In practice, our deliverability rates consistently exceed 98%, which matches or beats what most businesses see on SendGrid or Mailgun.

Cost

The total infrastructure cost for AstroMail is a fixed monthly fee regardless of volume. No per-email charges. No overage fees. A tenant sending 10,000 emails per month pays the same as a tenant sending 500,000. The savings at scale are significant.

The Trade-Off

Self-hosting email is not for everyone. It requires DNS expertise, server monitoring, and ongoing maintenance. We handle all of that for our tenants, but it is work that someone has to do. For a solo founder sending 500 emails a month, Mailgun is probably fine. For a business sending tens of thousands of emails across multiple domains, the economics and control of self-hosting are hard to beat.

More from the blog