Knowledge base

How to test email sending in MailerSend

Before sending transactional emails at scale, it's crucial to test the sending capabilities of your email delivery platform. This ensures that your messages are being delivered as expected and helps you avoid potential hiccups down the line. 

There are various methods to test sending capabilities in MailerSend. Specifically, we'll focus on using blackhole email recipients to validate your email flows.

What are Blackhole email recipients?

Blackhole email recipients are specialized email addresses that help you test your email sending without actually delivering the message to a real inbox. Emails sent to these addresses are automatically discarded, making them ideal for testing.

Use Cases

  • Debugging issues with email templates

  • Verifying webhook events

  • Confirming email tracking features

MailerSend provides the following set of blackhole email addresses designed to assist you in triggering various email events. These specialized addresses work for both the API and SMTP, giving you the flexibility to test your setup in multiple ways.

Email address SMTP Error Code Reason 550 User's mailbox was unavailable (not found) 421 The service is not available and the connection will be closed. 554 The transaction has failed (or you are not allowed to send to this recipient) 450 Requested email action not taken: mailbox unavailable (e.g. mailbox full or temporarily blocked) 450 Requested mail action not taken: DNS error 550 A DMARC policy issue. The recipient server did not accept out requests to connect.

How to send an email to a blackhole recipient

To send an email to a blackhole recipient, simply follow your usual email sending steps, but enter a blackhole email address in the "To" field. MailerSend will process the message like any other email but it will not be delivered to an inbox. Instead, expect to see logs and reports that confirm the email was processed, helping you to verify that your sending capabilities are functioning correctly.

Testing webhooks

Webhooks are a way to receive notifications from MailerSend when certain events occur, such as when an email is sent or delivered. To verify that a webhook is functioning correctly, you can send an email to a blackhole recipient and check if the webhook is triggered in your specified endpoint.

To create a webhook:

  1. Navigate to Email > Domains.

  2. Choose a domain and click Manage.

  3. Scroll down to Webhooks

  4. Click Add webhook.

  5. Enter a name and URL for your webhook and then select the events that you want to be notified of.

Once you have created a webhook, you can test it by sending an email to one of the blackhole email recipients listed above. If your email is successfully sent and the webhook is properly set up, you will receive a notification from MailerSend.

Checking email activity

The Email > Activity page shows a list of all of the emails that have been sent from your account. You can use the Activity page to test your sending capabilities by checking to see if your test emails are listed on the page.

To test your sending capabilities using the Activity page, simply send an email to one of the blackhole email recipients listed above. Then, go to the Activity page in MailerSend and refresh the page. Your test email should be listed on the page within a few minutes.

Testing your email-sending capabilities is an important part of ensuring that your transactional email campaigns are successful. Blackhole email recipients are a safe and easy way to test your email without having to worry about spamming real users.

Tip: Use a blackhole email address to test your sending capabilities before you launch a new transactional email workflow.