Home  >  Article  >  Backend Development  >  解决laravel 5 发送邮件提示:cannot send message without a sender address

解决laravel 5 发送邮件提示:cannot send message without a sender address

WBOY
WBOYOriginal
2016-06-20 12:52:361351browse

首先,laravel 5 的邮件配置,统一在 .env 文件里面,我们把他配置好

<br />MAIL_DRIVER=smtpMAIL_HOST=smtp.ym.163.comMAIL_PORT=25MAIL_USERNAME=账号MAIL_PASSWORD=密码

当我们配置好了以后,发送邮件还是提示错误

cannot send message without a sender address

这是因为我们需要去修改一下 mail.php 配置文件

打开 config/mail.php 找到 from 配置项

<br />'from' => ['address' => null, 'name' => null],

我们需要配置发件地址,和显示的昵称,把这两项配置好了就ok啦~

欢迎加入 laravel 学习小组:365969825 一起学习

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn