Skip to content

Mailgun

Mailgun sends email that your app prepares, such as a receipt, and records events that help explain what happened to it.

Visit Mailgun

What has to be connected before your app can send a receipt?

Add the sending domain to Mailgun and publish the records it supplies where you manage the domain. These records help receiving mail services check that Mailgun is allowed to send for you.

Choose the email API, which your app calls directly, or SMTP, the connection many apps already use for email. Match the endpoint or mail server to the domain’s Mailgun region. Keep the sending credential on the server. Your app still decides who receives a receipt and what it says.

Which test can you do without delivering a message?

Mailgun API test mode accepts a message without sending it. A Mailgun sandbox domain is different. It can actually deliver to recipients you authorize. Use test mode when you want to check what your app submits without contacting anyone.

  1. Confirm the isolated sender
    Use a test copy of the app with a verified test domain and matching region. Before submitting anything, verify the sending credential, that the request sets the API test option o:testmode to yes, and that any webhook or notification goes only to a test destination. If you cannot verify this, inspect the request on paper.
  2. Check one fictional receipt
    Use a made-up address on a reserved example domain and a fictional receipt without a live link. Check that the API accepts the request. That result covers the request format and acceptance. It tells you nothing about inbox delivery. Test-mode sends can be charged.

What does it mean when the receipt is accepted but hasn’t arrived?

Accepted means Mailgun took the request and queued the message. Delivered means the recipient’s mail server accepted it. The person may still need to look in their spam folder, and the event cannot tell you they opened it.

Look up the message by its ID in the logs. Check whether a failure is temporary or permanent. If the address was previously marked as a permanent bounce, inspect the bounce suppression list before retrying. Fix the address or the sending problem first.

Which limits and records matter when you change plans or providers?

Mailgun Free currently lists 100 emails per day and one custom sending domain. Compare the plan’s sending allowance and log history before relying on it for a busy app.

Use the Logs API for events within its available history and reporting CSV for aggregate figures. Keep the app’s templates and event history separately, and save the bounce addresses you need to preserve using the documented list. Check what the next provider can import before switching.