How to Send Receipts and OTP Emails From Your Own Domain (and Keep Them Out of Spam)

JMSURF Mail 5 min readBy JMSURF TECHNOLOGIES

Every online business sends automatic emails: order receipts, invoices, password resets, one-time codes, delivery updates. When those emails land in spam, or never arrive, customers cannot sign in, cannot find their invoice and call your support line instead.

The emails your system sends automatically are called transactional email. They are different from the mailbox your staff use every day and from marketing newsletters, and they need a little setup to arrive reliably. This guide explains how.

Business mailboxes vs transactional email

  • Business mailboxes (for example sales@yourdomain.co.ke) are for people: reading and replying to email in an inbox. These usually come with your web hosting or an email plan.
  • Transactional email is sent by your website or app, one message at a time, triggered by something the customer did. It is sent through an email API or SMTP service built for that job.
  • Marketing email (newsletters, offers) goes to lists and has its own consent and unsubscribe rules. Keep it separate from transactional mail so complaints about marketing do not affect your receipts.

Many systems send transactional mail through a shared mailbox password or the web server's own mail function. That is the most common reason receipts end up in spam.

Why automatic emails land in spam

Email providers check whether a message really comes from the domain it claims, and whether the sender has a good record. Messages fail when:

  • the domain has no SPF or DKIM records, or they are wrong;
  • the email is sent from a free mailbox address instead of your own domain;
  • the server sending it has a poor reputation;
  • many messages bounce because addresses are wrong.

Step 1: Send from your own domain

Use an address on your domain, such as orders@yourdomain.co.ke or no-reply@yourdomain.co.ke. It looks professional and lets you prove the mail is yours. If you do not own a domain yet, register one first; a .co.ke is the natural choice for a Kenyan business.

Step 2: Add SPF, DKIM and DMARC records

These are DNS records you add where your domain is managed. Your email service tells you the exact values.

  1. SPF lists the services allowed to send email for your domain.
  2. DKIM adds a digital signature to every message, which receiving servers check against a public key in your DNS.
  3. DMARC tells receivers what to do when a message fails those checks, and where to send reports. Start with a monitoring policy, then tighten it once all your legitimate mail passes.

Only one SPF record is allowed per domain, so if you already have one for your mailboxes, add the new service to it rather than creating a second.

Step 3: Connect your app through an API

An email API lets your system send a message with one request and get a clear answer back. Good practice for developers:

  • keep the API key on the server, never in website or mobile app code;
  • use templates for receipts and resets, so wording stays consistent;
  • use idempotency keys so a retry does not send the same receipt twice;
  • send in batches when you need to notify many customers at once.

Step 4: Watch deliveries, bounces and complaints

Delivery logs show what happened to each message. Webhooks tell your system about bounces and complaints as they happen, so it can stop emailing an address that does not exist. Bounce protection keeps your sending reputation healthy.

Step 5: Have a backup for critical messages

For one-time codes and urgent alerts, consider sending an SMS as well as, or instead of, email. A backup sending route also helps if one path has a problem.

Writing transactional emails customers trust

  • A clear subject: "Your receipt for order [order number]" beats "Notification".
  • Your logo and business name, and the same sender address every time.
  • The key information at the top (amount, code, link), and no marketing clutter.
  • A plain-text version alongside the HTML.

Frequently asked questions

Can I use a free webmail or hosting mailbox password in my app?

It may work at low volume, but it is fragile and often lands in spam. A transactional email service signs your mail with DKIM and gives you logs and webhooks.

What is the difference between SPF and DKIM?

SPF says which services may send for your domain. DKIM signs each message so receivers can confirm it was not changed and really came from your domain. You need both.

Can I send marketing newsletters through a transactional email API?

Keep them separate. Transactional services are built for messages a customer triggered, and mixing in marketing can hurt delivery of your receipts.

How long do DNS changes take?

Often minutes, sometimes a few hours. Your email service shows when each record is verified.

Send transactional email with JMSURF Mail

JMSURF Mail is a transactional email API for sending receipts, password resets, OTPs, invoices and notifications from your own domain, with DKIM signing, delivery logs, signed webhooks, bounce protection, templates, a backup SMTP route and an optional SMS in the same call through JMSURF SMS. The pricing page lists a free plan of 100 emails a month and paid plans from KES 499 a month, paid by M-Pesa or card. For staff mailboxes on your domain, JMSURFHOST web hosting includes business email.

Need help choosing or setting up? Talk to the JMSURF team.

Chat with us