Email Testing Tip: Using One Email Account for Multiple Email Addresses

How to use email aliases to test multiple email accounts with only one account.

Courtney Zhan
2 min readAug 21, 2022

During software testing, we often need to verify and read emails, such as ‘Account Activation’, ‘Password Reset’, ‘Invoice’, …, etc. If possible, for internal testing, I would test emails in Automated Test Scripts with a Fake SMTP server: MailCatcher, as it is quick, safe, and easy to verify (using automated scripts). However, sometimes, using a Fake SMTP server is not possible (requires dev support and setup).

This article shares a tip on how to use the same email account and receive emails from ‘multiple email addresses’.

A typical use case is the ‘User Sign up’ test case.

  • A unique email address can only be used once for sign-up
  • I don’t want to create a new email account every time we test this scenario.
    (‘User Sign up’ might be used often in test automation to create a unique user, to prevent test data conflicts. Check out this article Case Study: User Change Password Automated Test)

A simple solution is adding a plus sign (+) and any word before the @ sign in one email account, e.g. testwisely+101@gmail.com, testwisely+102@gmail.com.

Most apps will treat them as separate unique email addresses, but all emails will arrive at the same account, e.g. testwisely@gmail.com. This is known as email alias (one email address can have infinite aliases).

Here is a test. I sent two emails.

They arrived at the same Gmail account (testwisely@gmail.com).

Email details:

The email was sent to the aliased email (testwisely+102@gmail.com).

This alias trick should work for most email accounts, at least, Gmail and Outlook (I verified today).

--

--

No responses yet