Quickstart
By the end of this page you will have a mailbox, an API key, and a test that waits for an email and reads its body.
-
Create an account at app.mailcatchr.com/signup. The free plan needs no card and includes one mailbox with full API access.
-
Create a mailbox. New accounts come with one already. Its subdomain is shown on the mailbox page, for example
<mailbox-id>.mailcatchr.com. Anything sent to any address on that subdomain lands in the mailbox. -
Issue an API key. Open Workspace settings → API keys → New key. Choose which mailboxes the key may read (all, or a fixed set). The key is shown once; store it as a secret in your CI system. Keys look like
mc_live_…. -
Send yourself an email. From any mail account, send a message to
alice@<your-subdomain>.mailcatchr.com. It appears in the dashboard within a few seconds. Your application does the same thing in tests: it sends mail exactly as it does in production, just to an address on your subdomain. -
Wait for it from code. The call below blocks until a message to that address arrives, then returns its summary.
Terminal window curl -H "Authorization: Bearer $MAILCATCHR_API_KEY" \"https://api.mailcatchr.com/v1/mailboxes/$MAILBOX_ID/messages/await?to=alice@<mailbox-id>.mailcatchr.com&timeout=30"A
200carries the message summary. A204means nothing matched within 30 seconds.import { createClient } from "@mailcatchr/sdk";const mc = createClient({ apiKey: process.env.MAILCATCHR_API_KEY! });const summary = await mc.messages.await(mailboxId, {to: "alice@<mailbox-id>.mailcatchr.com",timeoutSeconds: 30,});if (!summary) throw new Error("No email arrived in 30 s");const message = await mc.messages.get(mailboxId, summary.id);console.log(message.subject, message.textBody);using var mc = new MailcatchrClient(new MailcatchrClientOptions{ApiKey = Environment.GetEnvironmentVariable("MAILCATCHR_API_KEY")!,});var summary = await mc.AwaitMessageAsync(mailboxId,to: "alice@<mailbox-id>.mailcatchr.com",timeout: TimeSpan.FromSeconds(30));if (summary is null) throw new Exception("No email arrived in 30 s");var message = await mc.GetMessageAsync(mailboxId, summary.Id);Console.WriteLine($"{message.Subject}: {message.TextBody}");import osfrom mailcatchr import Clientmc = Client(api_key=os.environ["MAILCATCHR_API_KEY"])summary = mc.messages.wait_for(mailbox_id, to="alice@<mailbox-id>.mailcatchr.com", timeout_seconds=30)if summary is None:raise AssertionError("No email arrived in 30 s")message = mc.messages.get(mailbox_id, summary.id)print(message.subject, message.text_body)var mc = MailcatchrClient.builder(System.getenv("MAILCATCHR_API_KEY")).build();var summary = mc.awaitMessage(mailboxId, AwaitMessageOptions.builder().to("alice@<mailbox-id>.mailcatchr.com").timeoutSeconds(30).build()).orElseThrow(() -> new AssertionError("No email arrived in 30 s"));var message = mc.getMessage(mailboxId, summary.id());System.out.println(message.subject() + ": " + message.textBody());mc := mailcatchr.New(os.Getenv("MAILCATCHR_API_KEY"))summary, err := mc.AwaitMessage(ctx, mailboxID, mailcatchr.AwaitOptions{To: "alice@<mailbox-id>.mailcatchr.com", TimeoutSeconds: 30,})if err != nil { t.Fatal(err) }if summary == nil { t.Fatal("No email arrived in 30 s") }message, _ := mc.GetMessage(ctx, mailboxID, summary.ID)fmt.Println(message.Subject, *message.TextBody)mc = Mailcatchr::Client.new(api_key: ENV.fetch("MAILCATCHR_API_KEY"))summary = mc.messages.wait_for(mailbox_id, to: "alice@<mailbox-id>.mailcatchr.com", timeout_seconds: 30)raise "No email arrived in 30 s" if summary.nil?message = mc.messages.get(mailbox_id, summary.id)puts message.subject, message.text_body$mc = new \Mailcatchr\Client(getenv('MAILCATCHR_API_KEY'));$summary = $mc->messages->waitFor($mailboxId, to: 'alice@<mailbox-id>.mailcatchr.com', timeoutSeconds: 30)?? throw new RuntimeException('No email arrived in 30 s');$message = $mc->messages->get($mailboxId, $summary->id);echo $message->subject, "\n", $message->textBody; -
Put it in a test. The guides show the full pattern for Playwright, Cypress, pytest, JUnit, xUnit, Go, RSpec and PHPUnit: trigger the email from the app under test, wait for it, pull the link or code out of the body, and continue.
Where to find things
Section titled “Where to find things”| You need | Where it is |
|---|---|
| Mailbox address and subdomain | Mailbox page, top of the screen |
| Mailbox id | The last part of the mailbox page’s URL, or id from GET /v1/mailboxes |
| API keys | Workspace settings → API keys |
| IMAP and POP3 credentials | Mailbox settings → POP3 / IMAP |
| Authenticators for two-factor codes | Tools → Authenticators |
| Webhook interceptors | Tools → Webhook Interceptor |
| Outbound sending | Mailbox settings → Outbound |
| Wallet | Workspace settings → Billing |