Laravel 5.1错误电子邮件发送gmail可以在本地但不在服务器上运行

I am having an error on Laravel email sending. I am using gmail as my mail driver. Everything works on local but it's a different story on dev server.

The server is Ubuntu 16.04 and Apache web server. I tried logging errors on laravel logs but to no avail.

Here's the error.

enter image description here

And here's the code block that's giving the error.

Mail::send(['text' => 'pages/reset-password-mail'], ['name' => 'Test', 'url' => $url], function($message) use ($email) {
     $message->to($email, $name = NULL)->subject('Reset Password');
     $message->from('test@gmail.com', 'Support');});

I have this in .env file

MAIL_DRIVER=smtp 
MAIL_HOST=smtp.googlemail.com 
MAIL_PORT=465 
MAIL_USERNAME=gmail username
MAIL_PASSWORD=gmail password
MAIL_ENCRYPTION=ssl

Any help would be greatly appreciated. TIA!