Laravel 5.6,电子邮件不是没有使用sendmail驱动程序在服务器上发送

I am using laravel 5.6 and i can send email on locale but not on server with sendmail driver.

MAIL_DRIVER=sendmail
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=null

I guess your server don't have the driver or the smtp server installed.

But if you have Laravel, you should try SwiftMailer because it's a much more robust way to send emails that will work well on almost any scenario.

Laravel provides a clean, simple API over the popular SwiftMailer library.

Mail::send is just a laravel wrapper for swift mailer, so you are calling swift mailer when doing that call unless you change 'driver' => 'smtp' to 'driver' => 'mail', only then will it use the PHP's mail.

Reference: Laravel Mail Documentation