Why JavaMail connection timeout is too long

后端 未结 5 941
广开言路
广开言路 2021-02-04 02:04

In my application I connect to server to authenticate users. This is code:

try {
        Properties prop = new Properties();
        prop.put(\"mail.smtp.startt         


        
5条回答
  •  遥遥无期
    2021-02-04 02:36

    Can you setup the Socket I/O timeout as well. When it is connected but failed to read data from the server then it will continue to wait.

    prop.put("mail.smtp.timeout", 1000);
    

    Read timeout indicates you are connected but not able to read data from the server.

提交回复
热议问题