配置获取邮件服务smtp
https://jingyan.baidu.com/article/425e69e61e9178be15fc168a.html
.env新增配置
MAIL_DRIVER=smtp
MAIL_HOST=smtp.qq.com
MAIL_PORT=465
MAIL_USERNAME=***@qq.com
MAIL_PASSWORD=***(来源在https://jingyan.baidu.com/article/425e69e61e9178be15fc168a.html 配置完成后生成的秘钥放到这)
MAIL_FROM_NAME=自定义
MAIL_ENCRYPTION=ssl
发送邮件代码
Mail::raw("email send content descript", function ($message) use ($to_email,$subject,$from)
{
$message->from(env("MAIL_USERNAME"), "来自哪描述");
$message->to(132@163.com(邮箱地址));
$message->subject("邮件主体描述");
});