Fake Email Generator

random email generator

What are fake email accounts

It can be tiresome to sign-up for a new email account every time you want to test something. Email generators like MailSlurp let you create real email addresses instantly using a web app or developer tools.

Receive emails to fake accounts

MailSlurp inboxes using @mailslurp.com addresses or your own custom domain. T

Email API access

You can generate fake email accounts programmatically using MailSlurp’s HTTP API or one of the many official SDK libraries.

email apis

Generate emails in code

Here is a brief example in PHP:

public function test_canSendEmail(): void
{
    // create a new inbox
    $inboxController = new MailSlurp\Apis\InboxControllerApi(null, $this->config);
    $inbox = $inboxController->createInbox();

    // send options
    $sendOptions = new MailSlurp\Models\SendEmailOptions();
    $sendOptions->setTo([$inbox->getEmailAddress()]);
    $sendOptions->setSubject("Welcome");
    $sendOptions->setIsHtml(true);
    // (you can use normal strings too)
    $sendOptions->setBody(<<<EOF
        <html>
            <h1>MailSlurp supports HTML</h1>
        </html>
    EOF);

    // send
    $inboxController->sendEmail($inbox->getId(), $sendOptions);
}

See the developer pages for API documention.