Setup email aliases

Email forwarding API for automatic email proxy. Setup auto-forwarding email aliases to mask a real email address.

email proxy

Email aliases let you hide an email address behind any number of generated email addresses that will forward their incoming messages to the hidden email address.

More information can be found on the alias product page. To configure forwarding to typical inboxes see the auto-forwarding rules guide.

What is an alias

Email aliases keep your email address hidden.

proxy email

An alias is an email address that can be used to mask another email address. When the alias receives an email it will be forwarded automatically to the email address it was created for.

You can manage aliases using the API, SDKs, or the dashboard.

create alias


You must manually verify an alias before it is active if the email address has not been validated for your account before.

create alias

Code example

Here is an example of how to use aliases using the official Javascript SDK and Jest.

 * Example of using an email alias to mask an address and forward emails to hidden address
const fetchApi = require('isomorphic-fetch');
const {
} = require('mailslurp-client');

// setup mailslurp config
const config = new Configuration({ apiKey, fetchApi });

// create controllers
const inboxControllerApi = new InboxControllerApi(config);
const aliasControllerApi = new AliasControllerApi(config);
const waitForController = new WaitForControllerApi(config);

// create two different email addresses for testing
const inboxA = await inboxControllerApi.createInbox({ name: 'inboxA' });
const inboxB = await inboxControllerApi.createInbox({ name: 'inboxB' });
const emailAddressA = inboxA.emailAddress!!;
const emailAddressB = inboxB.emailAddress!!;

// create an alias
const alias = await aliasControllerApi.createAlias({
  createAliasOptions: {
    emailAddress: emailAddressA,
    useThreads: true,
// emailAddressA has been masked by a new email address that was created by the alias

// alias isn't verified until you click the confirmation link sent to the aliased address

Then to receive the emails:

// can send email from inboxB to alias that should be delivered to inboxA
const sent = await inboxControllerApi.sendEmailAndConfirm({
  sendEmailOptions: {
    to: [alias.emailAddress!!],
    subject: 'Hello inbox A',
    body: 'From inbox B',


// now expect email is forwarded by alias to InboxA
const forwardedEmail = await waitForController.waitForLatestEmail({
  unreadOnly: true,
  timeout: 30000,

// received message
expect(forwardedEmail.subject).toContain('Hello inbox A');
// reply to is a thread address meaning your replies can be routed through a thread

Other options

For information see the developers page.