我继续从 Laravel 收到此错误,但一切看起来都是正确的:
Expecting response 250 but got "" with message ""
根据我的研究,问题发生在通过 Sendgrid(或任何提供商)发送电子邮件并且接收服务器以空白代码响应时。
SendGrid 没有传递空白代码,而是将其翻译成这样; Sendgrid 需要 250(一切正常)代码,但什么也得不到。
我不知道如何解决这个问题。我遇到过几个解决方案,但都没有用。
对于那些感兴趣的人,这里是通过 Controller 发送电子邮件的代码:
if ($circle->business)
{
$email = $circle->creator->email;
$name = $circle->creator->fullName();
}
else
{
$email = $user->email;
$name = $user->fullName();
}
Mail::send('layouts.'.$this->client->template->file.'.views.emails.transaction-receipt', compact('user'), function($message) use($user)
{
$message->from($user->account->email, $user->account->name);
$message->to($user->email, $user->name)->subject($user->account->name.' Transaction Receipt');
});
最佳答案
我遇到了同样的问题,因为我的 SendGrid 密码不正确。
如果您的凭据不正确,SendGrid 不会发送响应。
关于php - Laravel:期待响应 250 但得到 ""消息 "",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23702362/