Could not connect to SMTP host: smtp.gmail.com, port: 587; nested exception is: java.net.ConnectException: Connection timed out: connect

后端 未结 4 2053
小鲜肉
小鲜肉 2021-02-14 22:52

Here is the code of the application. I have been trying to run this using eclipse IDE. I also added all the required java mail jar files namely dsn.jar,imap.jar,mailapi.j

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-14 23:14

    Try this steps

    Step 2: Send mail from your device or application

    If you connect using SSL or TLS, you can send mail to anyone with smtp.gmail.com.

    Note: Before you start the configuration, we recommend you set up App passwords for the the desired account. Learn more at Sign in using App Passwords and Manage a user's security settings.

    Connect to smtp.gmail.com on port 465, if you’re using SSL. (Connect on port 587 if you’re using TLS.) Sign in with a Google username and password for authentication to connect with SSL or TLS. Ensure that the username you use has cleared the CAPTCHA word verification test that appears when you first sign in.

提交回复
热议问题