API Integration
Integrate Mailtrap email API. Get API credentials, choose transactional or bulk sending, use SDKs or code samples, and start sending.
Use API credentials to integrate Mailtrap with your project.
Go to the Sending Setup page under API/SMTP and choose the domain you want to send emails from. Remember that you'll be able to start sending emails once the domain is verified.
Select whether you want to send emails with the Transactional or Bulk Stream.
Toggle the switch to API.
Build the authenticated HTTP request in your programming language or framework and configure it with Mailtrap Host and API Token.
Alternatively, choose the programming language or framework from the menu under Code Samples and copy the sample configuration (it will already contain your credentials).
Verifying your configuration
Once you add Mailtrap Email API 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 specified in the script. The email will also appear in the Mailtrap Email Logs.

API tokens
Remember that each domain has different API tokens. You can also create additional API tokens by going to Settings → API Tokens and clicking Add Token.

Mailtrap Email Sending API supports:
attachments
Last updated
Was this helpful?

