How it works
Integrate Mailtrap directly into your Laravel application using our dedicated driver. This allows you to use Mailtrap as a mailer for all your appโs communications, from Notifications to Mailables, without changing your workflow. Swap between sandbox and sending with a simple configuration change and get industry-best deliverability.

Configuration
Step 1: Create a Mailtrap account, verify your domain, and get the API token.
Step 2: For a quick start, run one of the following commands โฌ๏ธ
# With symfony http client (recommend)
composer require railsware/mailtrap-php symfony/http-client nyholm/psr7 symfony/mailer
# Or with guzzle http client
composer require railsware/mailtrap-php guzzlehttp/guzzle php-http/guzzle7-adapter symfony/mailer
Step 3: Add mailtrap transport into your config/mail.php file.
<?php
return [
ย ย /*
ย ย |--------------------------------------------------------------------------
ย ย | Mailer Configurations
ย ย |--------------------------------------------------------------------------
ย ย */
ย ย 'mailers' => [
ย ย
ย ย ย ย ย ย // start mailtrap transport
ย ย ย ย ย ย 'mailtrap-sdk' => [
ย ย ย ย ย ย ย ย 'transport' => 'mailtrap-sdk'
ย ย ย ย ย ย ],
ย ย ย ย ย ย // end mailtrap transport
ย ย
ย ย ]
];
Set mailtrap-sdk transport as a default Laravel mailer and change the default mailtrap config variables inside your .env file.
Step 4: Set the API key to the MAILTRAP_API_KEY variable.
Step 5: Generate Mailable class with the following command.
php artisan make:mail WelcomeMail
Step 6: Configure and send your emails – hit the link to see an example.
For more details and examples, check the official docs for Mailtrap Laravel Bridge.
Supported functionalities
- Email sending – transitional and bulk.
- Batch sending.
- Contacts and contact lists management.
- Templates management.
- Sending domains management.
- Sending and getting sandbox emails.
- Managing sandbox projects.