All use cases
QA

QA & Staging Environments

Safely test email functionality without sending to production

Simply replace the email recipient with a MailBrew address to fully test email functionality without sending to real customers. Generate addresses via API, then retrieve and verify any emails sent to those addresses. Check HTML rendering, attachments, headers, and more.

Why MailBrew for this use case

01

Prevent production email accidents

Use MailBrew addresses as recipients to completely prevent staging emails from reaching production customers.

02

Detailed email verification

Verify HTML/text body, subject, sender, attachments, and every email component via REST API.

03

Team sharing

Share API keys across the team so all QA members can check test results. Centralized management via dashboard.

04

Instant detection via webhooks

Receive webhook notifications on email receipt for real-time test results. No polling needed.

Sample code

PHP (Laravel / PHPUnit)

PHP (Laravel / PHPUnit)
<?php
use Illuminate\Support\Facades\Http;

$apiKey = 'mb_your_key_here';
$base = 'https://api.mailbrew.io/v1';

$addr = Http::withHeaders(['X-API-Key' => $apiKey])
    ->post("$base/addresses", ['ttl' => 600])
    ->json()['data'];

$this->post('/api/orders', [
    'customer_email' => $addr['address'],
    'items' => [['product_id' => 1, 'qty' => 2]],
]);

$emails = Http::withHeaders(['X-API-Key' => $apiKey])
    ->get("$base/addresses/{$addr['address']}/emails")
    ->json()['data'];

$this->assertCount(1, $emails);
$this->assertEquals('Order Confirmation', $emails[0]['subject']);

Ready to try this use case?

Get started with the free plan today. No credit card required.

Create free account