50% off all paid plans: use code BLACKFRIDAY at checkout, until November 30. Get the deal

All posts
12 min readPigeonify

SMTP Relay Service: How It Works + 6 Providers Compared

What an SMTP relay service is, which ports to use, how to configure it, and how 6 providers compare on free tiers and entry prices in 2026.

Developer guide card: which SMTP port to use — 587 STARTTLS, 465 implicit TLS, 25 often blocked in cloud.

An SMTP relay service accepts email from your application, CMS, CRM or device over the standard SMTP protocol and delivers it to recipients on your behalf. Instead of running your own mail server, you point your software at the relay's host, port, username and password, and the provider handles IP reputation, authentication checks, retries, bounces and complaints.

This guide explains how SMTP relay works, how it differs from running your own server or using Gmail's SMTP, which ports and settings to use, and how six SMTP service providers compare: Pigeonify, SendGrid, Mailgun, Postmark, Amazon SES and Brevo. We make Pigeonify, so read our section with that in mind. We have tried to be specific about where the others do better.

Prices checked against each provider's published pricing in early October 2026; providers change prices often, so confirm on their pricing page before you buy.

What is an SMTP relay?

SMTP (Simple Mail Transfer Protocol) is the language mail servers use to pass messages to each other. "Relay" means one server accepts a message and forwards it toward its final destination.

When your app uses an SMTP mail relay, the flow looks like this:

  1. Your app opens a connection to the relay's SMTP host on port 587 or 465.
  2. The connection is encrypted with TLS.
  3. Your app authenticates with a username and password (often an API key).
  4. Your app hands over the message: sender, recipients, headers and body.
  5. The relay queues it, signs it with DKIM for your domain, and delivers it to the recipient's mail server, retrying if that server is temporarily unavailable.
  6. Bounces, complaints and delivery events come back to the relay, which records them and, on most providers, notifies you through webhooks.

From your app's point of view, the job is done at step 4. Everything after that is the provider's problem, which is the whole point.

SMTP relay vs your own mail server vs Gmail SMTP

There are three common ways to get mail out of an application. They suit very different situations.

Running your own mail server

You can install Postfix or a similar mail transfer agent on a server and send directly. It is free in licensing terms and gives you full control. In practice it is hard work:

  • New IP addresses have no sending reputation, and many cloud IP ranges are treated with suspicion by receiving servers.
  • You must configure reverse DNS, SPF, DKIM and DMARC correctly yourself.
  • You handle bounces, feedback loops, blocklist monitoring and queue management.
  • Many cloud hosts block outbound port 25, which direct server-to-server delivery depends on.

For most teams, the time spent here is better spent on the product. Our sending at scale architecture guide covers when self-hosting starts to make sense.

Gmail or Google Workspace SMTP

Searching for "smtp server host gmail" is common, because Gmail's SMTP server is an easy first step for a contact form or a quick script. It works for small amounts of personal mail. It is not a good foundation for an application:

  • Gmail and Google Workspace have daily sending caps designed for person-to-person mail. They are not built for app or bulk sending, and hitting the cap can block the mailbox temporarily.
  • Messages come from a personal or employee mailbox rather than a dedicated sending setup, which makes it awkward to separate app mail from human mail.
  • You get no delivery webhooks, bounce processing or suppression lists suited to application traffic.
  • Using a staff mailbox's credentials in an app creates security and offboarding headaches.

Gmail SMTP is fine for testing. For password resets, receipts or newsletters, use a dedicated SMTP service provider.

A dedicated SMTP relay service

A relay gives you managed IP reputation, domain authentication support, bounce and complaint handling, logs, and usually a REST API alongside SMTP. You pay a monthly fee or per-email price. For nearly every application sending to real customers, this is the sensible default.

Option Setup effort Cost Suited to app/bulk mail Bounce and complaint handling
Own mail server High Server cost plus your time Only with significant expertise You build it
Gmail / Workspace SMTP Low Included in account No, daily caps for personal mail Minimal
SMTP relay service Low Free tier, then monthly plan Yes Built in

Ports: 587, 465 and why to avoid 25

SMTP relay providers usually support several ports. Here is what to pick.

  • Port 587 with STARTTLS. The standard submission port. Your client connects in plain text and then upgrades to an encrypted connection with the STARTTLS command. This is the safest default for most libraries.
  • Port 465 with implicit TLS. The connection is encrypted from the first byte. Some libraries call this "SSL" or set secure: true. It is equally good; use it if your library or network prefers it.
  • Port 25. The original server-to-server port. Avoid it for submission from your app. Many cloud hosts block outbound traffic on port 25 to limit spam, so connections time out with confusing errors.

A frequent mistake is mixing these up: setting port 465 while telling the library to use STARTTLS, or port 587 with implicit TLS. If the connection hangs or fails at the handshake, check that pairing first.

Authentication and security

SMTP relays authenticate your app with a username and password, typically using the AUTH PLAIN or AUTH LOGIN mechanism inside the encrypted TLS session. On many providers the password is an API key or dedicated SMTP credential rather than your account password.

Good practice:

  • Use a dedicated SMTP credential for each app or environment, so you can rotate or revoke one without breaking others. Pigeonify supports scoped API key permissions for this.
  • Store credentials in environment variables or a secrets manager, never in source control.
  • Enable MFA on the provider account itself.
  • Authenticate your domain. SPF, DKIM and DMARC records tell receiving servers that the relay is allowed to send for you. Without them, even a good relay will struggle. Our SPF, DKIM and DMARC explainer walks through each one, and you can verify your records with the free SPF checker.

A typical SMTP relay configuration

Almost every framework reads SMTP settings from the same handful of values. Keep them in environment variables:

SMTP_HOST=smtp.your-provider.example   # for Pigeonify, use the host shown in your dashboard
SMTP_PORT=587                           # or 465 for implicit TLS
SMTP_USER=your-smtp-username
SMTP_PASS=your-smtp-password-or-api-key
SMTP_FROM="Your App <hello@yourdomain.com>"

Then reference them from your app. In Node.js with Nodemailer, for example:

const transporter = nodemailer.createTransport({
  host: process.env.SMTP_HOST,
  port: Number(process.env.SMTP_PORT),
  secure: process.env.SMTP_PORT === "465", // true for 465, false for 587 (STARTTLS)
  auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS },
});

Because the settings are generic, switching SMTP providers is mostly a matter of changing these values. With Pigeonify, moving from another relay means changing host, port and credentials; the rest of your code stays the same.

Framework-specific walkthroughs:

SMTP or API: which should you use?

Most SMTP relay providers also offer a REST API. SMTP is the better choice when your software only speaks SMTP (WordPress plugins, CRMs, printers, legacy apps) or when you want zero vendor-specific code. An API is usually better for new application code: it is faster per message, returns structured errors, and makes batch sending, scheduling and metadata easier. We cover the trade-offs in detail in SMTP vs API sending.

6 SMTP relay providers compared

All six providers below offer SMTP relay. Here is how their free tiers and entry plans compare.

Provider Free tier Entry paid plan Price at 50k emails/mo Notable strength
Pigeonify 5,000/mo, max 200/day, no card Pro $15/mo for 50,000 $15 SMTP, API and campaigns in one account
SendGrid 60-day trial, 100/day Essentials $19.95/mo for 50,000 $19.95 Largest ecosystem, since 2009
Mailgun 100/day Basic $15/mo for 10,000 $35 (Foundation) Inbound routing, email validation
Postmark 100/mo, no expiry Basic $15/mo for 10,000 $66 to $87 Transactional deliverability reputation
Amazon SES Not covered here $0.10 per 1,000, pay as you go $5 Lowest cost at volume
Brevo 300/day Starter from $9/mo for 5,000 Check pricing page Marketing, SMS and WhatsApp included

Pigeonify

Pigeonify offers SMTP relay and a REST API on every plan, including Free. Free covers 5,000 emails a month (max 200 a day) with one sending domain. Pro is $15 for 50,000 emails with 10 domains; Scale is $65 for 150,000. You also get signed webhooks, automatic suppression lists, bounce and complaint tracking, guided SPF/DKIM/DMARC setup and marketing campaigns in the same account. There is no overage billing; sending pauses at the limit until you upgrade.

Where others do better: we are newer with fewer integrations, logs are short on Free (1 day) and Pro (7 days), and our plans step rather than meter, so 100,000 emails is $30 but 150,000 moves you to $65. See our pricing for the full plan list.

SendGrid

SendGrid's SMTP relay is widely documented and supported by almost every tool that sends mail. Essentials costs $19.95 for 50,000 emails or $34.95 for 100,000. The permanent free plan has been replaced by a 60-day trial at 100 emails a day, and Essentials activity history is only 3 days. If your stack already integrates with Twilio, SendGrid is a natural fit.

Mailgun

Mailgun offers 100 free emails a day. Basic is $15 for 10,000 emails, Foundation $35 for 50,000, and Scale $90 for 100,000. Mailgun stands out for inbound routing and an email validation product, neither of which Pigeonify offers. Lower tiers have short log retention (1 day on Basic, 5 on Foundation).

Postmark

Postmark's free developer plan includes 100 emails a month with no expiry. Paid plans start at $15 for 10,000. It has the strongest reputation for transactional deliverability in this group, separates transactional and broadcast mail into different message streams, and keeps 45 days of history. It is also the most expensive at 50,000 emails.

Amazon SES

SES supports SMTP relay at $0.10 per 1,000 emails, making it far cheaper than anything else at volume. You start in a sandbox and must request production access, and bounce and complaint handling must be wired up through SNS. There are no contact lists or campaign tools. If you have AWS experience and want the lowest cost, it is hard to beat.

Brevo

Brevo includes transactional email over SMTP and API on its plans. The free plan allows 300 emails a day with Brevo branding, and Starter begins at $9 a month for 5,000 emails. It is a marketing-first platform with SMS and WhatsApp, which suits businesses that want everything from one vendor.

Is there a truly free SMTP server?

Short answer: there are free SMTP tiers, but no free SMTP relay is meant to carry a real business at scale. Here is the honest picture:

  • Free tiers from relay providers are the most practical option. Pigeonify gives 5,000 emails a month, Brevo 300 a day, Mailgun 100 a day, and Postmark 100 a month. These are real, permanent allowances, but they come with daily caps, fewer sending domains, short log retention or branding.
  • Gmail and Google Workspace SMTP cost nothing extra if you already have an account, but their daily caps are for person-to-person mail. They are not built for app or bulk sending.
  • Self-hosted servers are free software, but you pay in server costs, setup time and reputation management, and you may find port 25 blocked by your host.
  • Trials such as SendGrid's 60-day plan are useful for evaluation, not long-term free use.

If you send a few thousand emails a month, a free plan from a reputable relay is genuinely enough. Plan to upgrade once you grow, and pick a provider whose next tier you can live with.

Who should NOT choose Pigeonify for SMTP relay

  • You need to receive and parse inbound email. Mailgun or Postmark handle that.
  • You send around 100,000 emails a month and want the lowest managed price. SendGrid Essentials is cheaper at that volume.
  • You need the absolute lowest cost and can handle the setup. Amazon SES wins.
  • You need weeks of searchable logs without storing webhook events yourself. Postmark's 45-day retention is better.
  • You rely on a long list of native third-party integrations. SendGrid's ecosystem is bigger.

FAQ

What is an SMTP relay service?

An SMTP relay service is a provider that accepts email from your application over the SMTP protocol and delivers it to recipients for you. It manages sending IP reputation, retries, bounces and complaints, and supports domain authentication with SPF, DKIM and DMARC. You configure your app with the relay's host, port, username and password instead of running a mail server.

Which port should I use for SMTP relay?

Use port 587 with STARTTLS as the default, or port 465 with implicit TLS if your library prefers it. Both encrypt the connection. Avoid port 25 for sending from your application, because many cloud hosts block outbound port 25 and the connection will simply time out.

Can I use Gmail as an SMTP server for my app?

You can for testing or a very small contact form, but it is not a good fit for an application. Gmail and Google Workspace have daily sending caps meant for person-to-person mail and are not built for app or bulk sending. You also lose delivery webhooks, bounce processing and suppression lists that an SMTP relay provides.

Is there a free SMTP relay?

Yes, several providers have permanent free tiers. Pigeonify offers 5,000 emails a month (200 a day), Brevo 300 a day, Mailgun 100 a day and Postmark 100 a month. SendGrid now offers only a 60-day trial. Free tiers include daily caps and limited features, so they suit small apps and testing.

Is SMTP slower than using an email API?

SMTP involves more back-and-forth per message than a single HTTPS API call, so it is usually slower when sending large volumes from code. For typical application traffic the difference is rarely noticeable. Choose SMTP when your software only supports SMTP or you want provider-neutral settings; choose an API for new code that needs batch sending or rich metadata.

Do I still need SPF and DKIM if I use an SMTP relay?

Yes. The relay delivers your mail, but receiving servers check whether your domain has authorized that relay. Add the SPF and DKIM records your provider gives you and publish a DMARC policy. Without them, messages are far more likely to be rejected or filtered to spam, whichever provider you use.

Try Pigeonify's SMTP relay

Get SMTP credentials and a REST API key in the same account, with guided domain setup. Start free — 5,000 emails a month, no card.

Send email that actually arrives

Authentication, suppression and bounce handling built in. Start free, no card required.

Start free