1

我正在为我的 Laravel (5.3) Homestead 应用程序使用以下 Mailtrap 配置,但每当我使用 Mail Facade 时都会出现以下错误

Expected response code 220 but got code "", with message ""

.env

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=**************
MAIL_PASSWORD=**************
MAIL_ENCRYPTION=null

控制器

    public function send()
    {
      $result = Mail::send('emails.test',['content' => 'This is the email Content'], function($message) {
        $message->from('noreply@mydomain.com');
        $message->to('my@email.com')
        ->subject('Test Email');

      });

      return $result;
    }

我已经尝试过MAIL_ENCRYPTION=ssl,但我最终得到Connection could not be established with host mailtrap.io [ #0]

有人可以建议或可能告诉我我做错了什么吗?

4

1 回答 1

3

终于解决了我的问题。

我不得不更改 MailTrap 配置

MAIL_PORT=2525

MAIL_PORT=465

感谢@Manish 在评论中发现了这一点。

于 2016-08-29T12:11:31.003 回答