Preview: SendMock has no stable release yet. These docs follow develop.
SendMock
Mail

Replies and forwards

Act as the person your app emailed. Reply, reply all or forward, and the result arrives as incoming email for your app.

Try it in the demo.

Many apps let people answer an email: a support ticket notification, a comment digest, a "reply to this message" address like [email protected]. In production the provider (Mailgun, SendGrid, Postmark) receives that reply and posts it to your app. SendMock does the same locally.

What it solves

  • Your "reply by email" feature can only be tested in production.
  • You need the reply's new text without the quoted original (stripped-text).
  • A forwarded email should open a ticket in your support inbox.

Reply, reply all and forward

Open an email your app sent and press:

  • Reply (R): from one of the original recipients, to the original Reply-To (or From), with Re: and the original quoted below, like a mail client.
  • Reply all (Shift+R, only with more than one recipient): as Reply, with the other recipients in Cc.
  • Forward (F): to an address you type (the inbound domains from Settings are suggested), with Fwd:, the forwarded-message block and, by default, the attachments.

The composer opens under the header with the original already in the message box, so you can trim it like any text. Send reply works straight away: send it as prefilled, edited or with an empty message box. Send forward waits for a To address. Ctrl+Enter (Cmd+Enter on macOS) sends; Esc closes.

Where it goes

Above the buttons, Delivers to lists everything that will receive the email before you send it: each URL or address an inbound route forwards or notifies, in the order the routes run (ending at one that calls stop()), and each webhook rule on email.inbound with its endpoint URL. Each line links to its route or rule. For a forward, the row follows the To address as you type.

When nothing would receive it, the row says Nothing receives this yet. To send replies to your app in one step:

  1. Press Send replies to your app.
  2. Enter your app's URL, for example http://localhost:8000/webhooks/mail.
  3. Choose Only mail to this address (a match_recipient() route for exactly this address) or Every incoming email (a catch_all() route).
  4. Press Create route.

The new route shows in the row and in Webhooks > Inbound routes, where More options opens the full editor.

Below it, the Webhooks row names the endpoints the email's email.inbound will reach through webhook rules, each opening in a new tab. Change picks other endpoints for this one reply or forward; Delivers to then lists them as "Chosen" in place of the rule matches, and Use the rules goes back.

After sending

The toast lists each webhook request the email caused, with its URL and status. The status moves from pending to the HTTP status (or the error) as the request is answered, and each line opens the request in Deliveries. Open jumps to the new email, whose header lists the same requests. When nothing received it, both say so and link to Webhooks > Inbound routes.

What happens next

  1. The reply is stored as an incoming email: it has the Inbound badge and a "Reply to" or "Forward of" link back to the original. The original lists it under Replies and forwards and in its Timeline.
  2. SendMock fires email.inbound (not email.received, so rules on mail your app sends never loop on replies).
  3. Inbound routes decide where it goes, as Mailgun Routes do: for example, match_recipient("reply\+(?P<ticket>.+)@reply.app.test") posts it to your app in Mailgun's format with stripped-text holding only the new text.
  4. The post shows in Deliveries, and in the email's Timeline as "Forwarded by route ...".

Other incoming mail

  • Mail that arrives over SMTP for an inbound domain (set in Settings > Email, for example reply.app.test) is treated as incoming too.
  • POST /api/v1/emails/inbound creates any incoming email, for example a fresh message to [email protected].

Step by step: Recipe: reply by email.

From the CLI, API and AI

On this page