How to see email content in Mailgun (sent, received & failed)

Mailgun records what happened to every message, but viewing the message itself is harder. Here is where to look for sent, received, and failed email, and what to do when you need more than 3 days of history.

What Mailgun shows you

Mailgun is built around events, not mailboxes. The logs list events such as accepted, delivered, opened, clicked, and failed, with recipient, subject, and timestamps. The full message body is only available while Mailgun has a stored copy.

How to view sent emails in Mailgun

  1. Log in to the Mailgun control panel and open the Logs for your sending domain
  2. Search by recipient, subject, or message ID, or filter by event type
  3. Expand a log entry to see delivery details and headers
  4. If a stored copy exists, open its storage URL to see the message content

How to view received emails

Incoming mail is only visible if a route keeps it. With a store() route, Mailgun saves the message and gives you a URL to retrieve it. With a forward() route, the message goes to another inbox or webhook. Not sure how routes work? Read can Mailgun receive emails.

How to see failed emails in Mailgun

Filter the logs by the failed event. Permanent failures (bad address, rejected by the receiving server) usually add the recipient to your suppressions list. Temporary failures are retried automatically. The log entry shows the error message from the receiving server, which tells you what to fix.

View email content with the Mailgun API

Stored messages can be fetched over HTTPS with basic auth: username api and your private API key as the password. Opening the storage URL in a browser prompts for these credentials. That is fine for debugging, but not for reading email every day.

# Copy the storage URL from the log entry or the stored event
curl -s --user "api:YOUR_API_KEY" "STORAGE_URL_FROM_LOG"

Use the exact storage URL from the event or log entry. The host depends on your region and where Mailgun stored the message.

The 3-day problem, and a simpler way

Stored messages are deleted after up to 3 days, and logs are for troubleshooting, not for reading conversations. If you want to keep, search, and reply to your Mailgun email, you need an inbox.

Inboxes saves every sent and received message in a Gmail-like inbox, with delivery status (accepted, delivered, opened, failed) on each one. Mailgun itself has no webmail: learn more about Mailgun webmail.

Frequently asked questions

Only while the message is stored. Logs show events (accepted, delivered, failed) and metadata. When a stored copy exists, the log entry links to it, and you can open it with your API key.

Read your Mailgun or Resend email in a real inbox

Connect your provider API key and get a Gmail-like inbox for every mailbox. $5/month.

Get started

Related guides