Laravel邮件记录 [英] Laravel Mail to Log
问题描述
我已设置Laravel Mail驱动程序以打印到日志文件:
I have my Laravel Mail driver setup as to print to my log file:
'driver' => env('MAIL_DRIVER', 'log'),
但是,当我发送邮件时,我收到了swiftmail身份验证错误:
When I send mail, however, I am receiving a swiftmail authentication error:
期望的响应代码为250,但收到消息为"530 5.7.1"的代码为"530" 需要验证"
Expected response code 250 but got code '530' with message '530 5.7.1 Authentication required'
vendor\\swiftmailer\\swiftmailer\\lib\\classes\\Swift\\Transport\\AbstractSmtpTransport.php
第383行,> AbstractSmtpTransport.php第383行
line 383\">AbstractSmtpTransport.php line 383
530 5.7.1 Authentication required
我是否需要在其他地方设置其他设置?为什么要尝试使用swiftmailer?
Is there another setting I need to set somewhere? Why is it trying to use swiftmailer?
推荐答案
这位于您的Mail.php配置文件中...
This is in your Mail.php config file...
使用
'driver' => env('MAIL_DRIVER', 'log'),
这将在.env文件中设置MAIL_DRIVER环境变量.在这种情况下,如果您的.env文件中未指定值,则'log'仅用作默认值...您的.env文件中可能仍设置了此值...将其设置为log ... >
This will get the MAIL_DRIVER environment variable set in your .env file. In this case, 'log' is used only as a default if a value is not specified in your .env file... Your .env file probably has this still set in it... set it to log...
MAIL_DRIVER=smtp
替换为
MAIL_DRIVER=log
这篇关于Laravel邮件记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!