Laravel: Expecting response 250 but got “” with message “”

对着背影说爱祢 提交于 2019-12-07 02:07:22

问题


I continue to get this error from Laravel, but everything looks correct:

Expecting response 250 but got "" with message ""

From what I've been able to research, the problem occurs when sending email through Sendgrid (or any provider) and the receiving server responds with a blank code.

Instead of passing along the blank code, SendGrid translates it into this; Sendgrid expects the 250 (every thing is okay) code, but gets nothing.

I don't know how to fix this. I've come across a couple solutions, but they didn't work.

For those who are interested, here is the code that sends the email via a 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');
        });

回答1:


I had this same problem because my SendGrid password was incorrect.

If your credentials are incorrect SendGrid doesn't send a response.



来源:https://stackoverflow.com/questions/23702362/laravel-expecting-response-250-but-got-with-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!