【发布时间】:2017-02-11 19:31:42
【问题描述】:
谁能帮助我使用 Laravel 邮件功能?
我将 config/mail.php 文件更改为
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'mail.concept.kz'),
'port' => env('MAIL_PORT', 25),
'from' => ['address' => 'support@concept.kz', 'name' => 'asdf'],
'encryption' => env('MAIL_ENCRYPTION', null),
'username' => env('support@concept.kz'),
'password' => env('mypassword'),
'sendmail' => '/usr/sbin/sendmail -bs',
这是我在控制器中的代码
Mail::raw($messageBody, function($message) {
$message->from('support@concept.kz', 'Learning Laravel');
$message->to('receiver@mail.ru');
});
if (Mail::failures()) {
echo 'FAILED';
}
return redirect()->back();
我对 .env 文件进行了相同的更改,但没有任何反应。 谁能给我建议该怎么做?难道我做错了什么?
【问题讨论】:
-
你得到什么错误?
-
@lewis4u 我没有收到任何错误。
-
阅读此完整指南unitedwebsoft.in/blog/…