Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel-Sendgrid smtp错误“;550不允许未经验证的发件人”;_Php_Laravel_Email_Smtp_Sendgrid - Fatal编程技术网

Php Laravel-Sendgrid smtp错误“;550不允许未经验证的发件人”;

Php Laravel-Sendgrid smtp错误“;550不允许未经验证的发件人”;,php,laravel,email,smtp,sendgrid,Php,Laravel,Email,Smtp,Sendgrid,我在下面发送电子邮件 我按照文档中的说明做了,所有凭据都与我的sendgrid凭据相同 但是每当我尝试用 Mail::send('mails.demo', $data, function($message) { $message->to('test@gmail.com', 'test')->subject('This is a test mail!'); }); 它将错误显示为 Swift_TransportException

我在下面发送电子邮件

我按照文档中的说明做了,所有凭据都与我的sendgrid凭据相同

但是每当我尝试用

Mail::send('mails.demo', $data, function($message)
        {
            $message->to('test@gmail.com', 'test')->subject('This is a test mail!');
        });
它将错误显示为

Swift_TransportException in AbstractSmtpTransport.php line 383:
Expected response code 250 but got code "550", with message "550 Unauthenticated senders not allowed
"

我可以发送电子邮件使用sendgrid测试使用,这是完美的工作

“不允许550个未经身份验证的发件人”
明确表示您的系统未尝试进行身份验证。所以你并不是真的通过网络发送你的证书。您应该检查您的Laravel配置,并确保它将在从以下位置发送
邮件之前发送
AUTH
命令。

我的团队中也遇到过同样的问题,一旦我与开发人员确认,开发者在.env文件和config/mail.php文件中添加了sendgrid凭据


可能也会出现同样的问题,如果是这样,请将config/mail.php还原为在laravel安装中创建的。

您应该创建发件人身份并进行验证。
或者,如果您使用域,您应该验证您的域

您的“发件人”地址应与conf/mail.php中的smtp配置匹配。您是否可以发布配置文件,且凭据不清楚?您使用的“发件人”地址是否与sendgrid中注册的“发件人”地址匹配?@yivi我使用的是“验证发件人”电子邮件(我们只有一封电子邮件用于此目的)