我正在为我的 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]
有人可以建议或可能告诉我我做错了什么吗?