Prestashop - ubuntu 16.04上的gmail smtp`预期的响应代码220但是得到了代码“”,带有消息“”`

I have 2 installation of prestashop:

  1. prestashop 1.6.1.4, Ubuntu 14.04.5 LTSm PHP 5.5.9-1ubuntu4.20

and

  1. prestashop 1.6.1.0, Ubuntu 16.04.1 LTS, PHP 7.0.8-0ubuntu0.16.04.3

I set up emails to smtp.gmail.com:465, TLS, email/password.

On the first installation it works, on the second instaltion it fails with Expected response code 220 but got code “”, with message “

Note: I set up two step verification and app password, I verified it is working with the first installation.

Please help.

Solution: change the Encryption to SSL

In prestashop admin > Advanced Parameters > E-mail

check Set my own SMTP parameters (for advanced users ONLY)

Fill the SMTP fileds

SMTP server: smtp.gmail.com

SMTP username: <****>

SMTP password: <****>

Encryption: SSL

Port: 465