php - Laravel8 sendmail 驱动程序无法正常工作
问题描述
我想问一下我的 .env 和 mail.php 是否正确。我已经检查了这里所有相关的问题,但到目前为止,所有这些问题都导致我出现同样的错误。下面是错误信息
无法启动进程 [系统找不到指定的路径。] {"exception":"[object] (Swift_TransportException(code: 0): Process could not be started [The system cannot find the path specified.] at C:\xampp4\htdocs\payroll\vendor\swiftmailer\swiftmailer\lib \classes\Swift\Transport\StreamBuffer.php:294)
这是我的 .env 文件
MAIL_MAILER=sendmail
MAIL_SENDMAIL='/usr/sbin/sendmail -t -i'
这是我的mail.php
<?php
return [
'default' => env('MAIL_MAILER', 'smtp'),
'sendmail' => env('MAIL_SENDMAIL', '/usr/sbin/sendmail -bs'),
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 2525),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'auth_mode' => null,
],
'ses' => [
'transport' => 'ses',
],
'mailgun' => [
'transport' => 'mailgun',
],
'postmark' => [
'transport' => 'postmark',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL', '/usr/sbin/sendmail -bs'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
],
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];
解决方案
推荐阅读
- angular - Angular - 用于同一组件中的两个元素时,ngx剪贴板抛出错误
- flutter - 取消飞镖中的请求
- python - 没有数据库的烧瓶登录
- android-studio - 如何获取当前连接的 wi-fi 网络的 SSID 和 PASSWORD
- sql - 如何在 SQL 中存储 Json 查询?
- azure - Docker:你可以拥有的 build-arg 的数量有限制吗?
- websocket - 房间里的 Socket Ids 不稳定
- python - 使用验证集测试模型的泛化能力
- python - Python:如何使用 openCV 修复图像中的杂乱区域?
- c# - 在 C# 和 ASP.NET MVC 中上传大文件