Expected response code 250 but got code "501", with message "501 mail from address must be same as , with message "501 mail from address must be same as authorization user
from参数中的$from与$name 必须与环境配置文件相同
Mail::send($view, $data, function ($message) use ($from, $name, $to, $subject) {
//from参数中的$from与$name 必须与环境配置文件相同
$message->from($from, $name)->to($to)->subject($subject.$to);
});
正确示例:
MAIL_MAILER=smtp
MAIL_HOST=smtp.qq.com
MAIL_PORT=465
MAIL_FROM_ADDRESS=QQ邮箱
MAIL_FROM_NAME=QQ邮箱
MAIL_USERNAME=QQ邮箱
MAIL_PASSWORD=授权码
MAIL_ENCRYPTION=ssl