Support the ongoing development of Laravel.io →
Laravel Configuration

I am using Laravel 7 and I want to send an email using sendemail driver using Laravel Mail Facade because it worked when I used php mail function but I want to use the Laravel Mail Facade.

This is my .env file email configration

MAIL_DRIVER=sendmail
MAIL_SENDMAIL='/usr/sbin/sendmail -t -i'
MAIL_HOST="hostname"

And this is my default mail in config/mail.php

'default' => env('MAIL_MAILER', 'sendmail'),
'mailers' => [
    'smtp' => [
        'transport' => 'smtp',
        'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
        'port' => env('MAIL_PORT', 587),
        'encryption' => env('MAIL_ENCRYPTION', 'tls'),
        'username' => env('MAIL_USERNAME'),
        'password' => env('MAIL_PASSWORD'),
    ],
    'ses' => [
        'transport' => 'ses',
    ],
    'sendmail' => [
        'transport' => 'sendmail',
        'path' => '/usr/sbin/sendmail -bs',
    ],
    'log' => [
        'transport' => 'log',
        'channel' => env('MAIL_LOG_CHANNEL'),
    ],
    'array' => [
        'transport' => 'array',
    ],
],

And I have created Mail class and a view as explained in the docs. but there is no email sent, and no error being shown in the docs. what is the right configuration how make it work ?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Amir amir Joined 7 Mar 2020

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.