# Basic Usage
Add to your .env file the names of the mailers to configure remember that by default use as separator |
:
MAIL_MAILER=test|prod
MAIL_DRIVER=smtp|smtp
MAIL_HOST=smtp.mailtrap.io|mail.mydomain.com
MAIL_PORT=2525|2665
MAIL_USERNAME=xxxxxxxxxxxxx|xxxxxxxxxxxxx
MAIL_PASSWORD=xxxxxxxxxxx|xxxxxxxxxxx
[email protected]|[email protected]
MAIL_FROM_NAME=Test1|[email protected]
MAIL_ENCRYPTION=null|TLS
As seen in the laravel-mailers
configuration uses the same environment variables as Laravel, just addMAIL_MAILER
which assigns the names of the mailers:
# Default Mailer
The default mailer is the first in this case test
:
MAIL_MAILER=test|prod
# Examples
Usar mailer test
:
Mail::to('[email protected]')
->send(new SendAttachmentDocument());
// or
Mail::mailer('test')
->to('[email protected]'])
->send(new SendAttachmentDocument());
Usar mailer prod
:
Mail::mailer('prod')
->to('[email protected]'])
->send(new SendAttachmentDocument());