Skip to main content

Testing Emails with Mailtrap

Mailtrap.io is an Email Delivery Platform built to help product companies ensure fast email delivery and high inboxing rates. It combines an intuitive interface for marketers to send impactful campaigns, a reliable API/SMTP services for developers, and a secure testing environment to ensure email quality before sending.

By acting as a dummy SMTP server, Mailtrap Email Sandbox eliminates the need for complex email authentication (SPF, DKIM, DMARC) in pre-production environments and provides a secure inbox to catch all test emails, allowing you to safely verify their content and functionality.

Prerequisites

  1. Create a Mailtrap account
  2. In the Mailtrap dashboard, select "Email Testing" from the left navigation
  3. Click "Inboxes" and then select your inbox
  4. In the Integration tab, find your SMTP credentials which include:
    • Host (sandbox.smtp.mailtrap.io)
    • Port (choose from available options: 25, 465, 587, or 2525)
    • Username
    • Password

Configure Medplum Server

  1. Open your Medplum server configuration file (default location for local development: packages/server/medplum.config.json)

  2. Set your sender email address:

"supportEmail": "support@example.com"
  1. Add Mailtrap SMTP settings:
"smtp": {
"host": "sandbox.smtp.mailtrap.io",
"port": 587,
"username": "username",
"password": "password"
}

Testing

After saving the configuration, restart the Medplum server. All emails will now be sent to your Mailtrap inbox. You can test this by:

The emails will appear in your Mailtrap inbox instead of being delivered to actual recipients.