Email API vs sending from your own server: which is better for your app?
Many Kenyan websites send receipts with PHP's mail() or through the cPanel mailbox that came with their hosting. It works, until emails start landing in spam or the host blocks outgoing mail. Here is how that compares with an email API.
Option 1: PHP mail() or your web server
The web server hands the message to its local mail program. It costs nothing extra, but the server's IP address is shared with other sites on a shared host, often has no DKIM for your domain, and may already be on a block list. Receivers treat this mail with suspicion. You also get no record of whether anything was delivered.
Option 2: your hosting mailbox over SMTP
Better: you log in to a real mailbox (for example [email protected] on cPanel) and send through it. But shared hosting usually limits how many emails an hour a mailbox may send, the IP is still shared, and when a mailbox password leaks it can be used to send spam in your name. Logs are minimal and there are no delivery events.
Option 3: your own mail server on a VPS
Full control, but you are now running a mail server: a clean static IP, reverse DNS, DKIM signing, TLS, bounce handling, block-list monitoring and security updates. New IPs need weeks of careful "warm-up" before big mailbox providers trust them. It is a real job, not a one-time setup.
Option 4: a transactional email API
Your code makes one HTTPS request and the service delivers from an established network, signed with DKIM on your own domain. You get a log of every email, delivery events by webhook, and automatic bounce handling.
Side by side
| PHP mail() / web server | Hosting mailbox (SMTP) | Own mail server | Email API (JMSURF Mail) | |
|---|---|---|---|---|
| Inbox placement | Often poor | Fair | Good once warmed up and maintained | Good, DKIM on your domain |
| Delivery logs and events | None | Minimal | What you build | Every email, timeline, webhooks |
| Bounce handling | None | Manual | What you build | Automatic suppression |
| Sending limits | Host decides | Hourly caps on shared hosting | Your IP reputation | Plan allowance, 20 requests/s per key |
| Work for your team | Low, until it breaks | Low | High and ongoing | Low: one API call |
| Cost | Included | Included | VPS plus your time | Free to start, KES plans by M-Pesa |
When your own server is fine
- Internal alerts to your own staff where a delay does not matter.
- Very small volumes on a domain you control well, if you accept no delivery tracking.
When an API is the better choice
- Receipts, OTPs and password resets that must arrive in seconds.
- Any system where customers say "I didn't get the email" and you need to check.
- Apps on shared hosting where outgoing mail is limited or blocked.
- Systems you build for clients, where you do not want to be the mail administrator.
Moving from mail() or SMTP to the API
Replace the place your code sends mail with a call to POST /emails: see the guides for PHP and Laravel, Node.js and Python. JMSURF Mail does not offer an SMTP login for customers yet, so SMTP-only software needs that small code change. You can keep your old SMTP server as a backup route in Settings: if our network refuses a message for a reason on our side, it goes out through yours.
Questions
- Will my emails still come from my domain?
- Yes. With an API like JMSURF Mail, emails go out from your own verified domain, signed with DKIM.
- Can I keep my cPanel mailboxes?
- Yes. Your normal mailboxes keep working; the API is only used by your app to send.
Send your first email today
Free plan with 100 emails a month, no card needed. Questions? WhatsApp or call +254 712 504 593, or email [email protected].