SMTP Integration
Learn how to integrate your application via SMTP.
Locating your Mailtrap credentials
Go to the Sending Domains tab and choose the domain you want to send emails from.
Keep in mind that the domain must be verified in order for you to start sending emails.

Navigate to the Integrations tab for your selected domain and select whether you want to use our Transactional Stream or Bulk Stream.

Transactional Stream is used to send automated, non-promotional application emails that are triggered by the user's specific action.
Bulk Stream is used to send a single marketing campaign to a large group of recipients in bulk.
Once you choose your preferred sending stream, click on SMTP. There, you will be able to see your Mailtrap credentials.

Method #1. Manual SMTP configuration
If you're using a tool like WordPress or Salesforce, you can simply copy/paste credentials such as Host, Port, Username, and Password. Here are some examples:
If you want to send emails from WordPress, you can use one of the many plugins (e.g., WP Mail SMTP or Post SMTP). For example, if you are using WP Mail SMTP, you can just navigate to the settings page and insert the Mailtrap credentials there.

To send emails from Salesforce, simply add your Mailtrap credentials to your Email Relay configuration, just like so:

Method #2. Copy/pasting code samples
If you have a programming project, you can also copy/paste one of the pre-made code samples for various programming languages and frameworks. For instance:
For Nodemailer, all you need to do is copy/paste the pre-made transporter object from Mailtrap into your main configuration file (i.e., index.js).
Similarly, for Laravel, you can just copy the code snippet from Mailtrap into your .env file:
Verifying your configuration
Once you add Mailtrap SMTP to your project, try sending an email from the tool of your choice or the project you're working on. If you did everything correctly, you should find the sent email in the inbox of the email address you indicated in the script. The email will also appear in the Mailtrap Email Logs.

Remember that each domain has different SMTP credentials that you can always access by clicking on the desired domain and going to the Integrations tab.
You can also create additional API tokens (or SMTP passwords) by going to Settings → API Tokens and clicking Add Token.

If you need any help with SMTP integration, please, contact our support team at [email protected].
Last updated
Was this helpful?

