我使用的是laravel5.4。
在使用过程中,发送邮件,遇到错误:Laravel - Connection could not be established with host smtp.gmail.com [ #0]
解决方式:Try adding the following lines to _establishSocketConnection()
in Swift/Transport/StreamBuffer.php on line 263:
$options['ssl']['verify_peer'] = FALSE;
$options['ssl']['verify_peer_name'] = FALSE;
还可能遇到的错误:
Swift_TransportException in AuthHandler.php line 181:
Failed to authenticate on SMTP server with username "a787031584@163.com" using 2 possible authenticators
这个错误是由于.env中MAIL配置不正确,注意,MAIL_PASSWORD写的是客户端授权码,而不是邮箱密码