mazi / mailtrap-driver
A Mailtrap email driver for Laravel.
Requires
- php: >=7.0 | <8.3
- guzzlehttp/guzzle: ^7.0.1
- illuminate/mail: ^6|^7|^8|^9
- illuminate/support: ^6|^7|^8|^9
Requires (Dev)
- phpunit/phpunit: ^9.6
This package is auto-updated.
Last update: 2025-05-29 01:48:57 UTC
README
# Mailtrap Laravel Driver
This package provides a Mailtrap driver for Laravel, allowing you to send emails in your Laravel application via the Mailtrap service.
## Installation
You can install the package via composer:
composer require mazi/mailtrap-driver
Configuration
After installing the package, you need to add the service provider to the providers
array in config/app.ph
<?php
'Mazi\MailtrapDriver\MailtrapServiceProvider',
?>
Then, in your .env
file, set the MAIL_MAILER
or MAIL_DRIVER
(depending on your Laravel version) to mailtrap
:
MAIL_MAILER_=_mailtrap
Also, add your Mailtrap API Token to your .env
file:
MAILTRAP_API_TOKEN_=_your-mailtrap-api-token
<?php
Mail::to('test@example.com')->send(new TestMail());
?>