0x0
0x0

Reputation: 373

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

I am using the below Mailtrap configuration for my Laravel (5.3) Homestead app but I get the following error whenever I use the 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

Controller

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

      });

      return $result;
    }

I've tried MAIL_ENCRYPTION=ssl but I end up with Connection could not be established with host mailtrap.io [ #0]

Could someone advice or probably tell me what I am doing wrong?

Upvotes: 1

Views: 9628

Answers (1)

0x0
0x0

Reputation: 373

Finally fixed my issue.

I had to change MailTrap configuration

from

MAIL_PORT=2525

to

MAIL_PORT=465

Thanks to @Manish for spotting that in the comments.

Upvotes: 3

Related Questions