Sending the email to the following server failed : smtp.gmail.com:25

十年热恋 提交于 2019-12-02 21:01:13

1. Here is a working configuration for GMail :

smtp.host=smtp.gmail.com
smtp.port=587
smtp.ssl=yes
smtp.user="me@gmail.com"
smtp.password="myPassword"

You must use port 587 (and so activate SSL)

2. Also ensure that Two factor authentication is not activated (otherwise you must generate a new application password)

3. Another cause of connection fail : it can be seemed like a suspect connection.

So check mails received from google on your account to ensure the connection has not been blocked by google (happens if play is hosted in another country than the one you are used to connect manually)

smtp:port=587 didn't work for me. but port 465 worked for me.

And turn on google less secure app setting

smtp.host=smtp.gmail.com
smtp.port=465
smtp.ssl=true

You should first enable the access in Google for less secure App as shown in the above answer. Now Change the port to 465 and set ssl=true. Or you can set port=587 and tls=true. This is because port 465 is for SSL and port 587 is for TLS according to the official documentations.

port=465
ssl=true

**Note that port=587 with ssl=true won't work

If you feel all settings are correct, but still getting this message; I'd suggest to look at the attachments. I was sending a .JAR file which gmail servers won't allow you to attach and hence it was rejecting my email. I had to rename the file to .JARA to make it work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!