Why JavaMail connection timeout is too long

后端 未结 5 939
广开言路
广开言路 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:33

    I had the same problem. It worked with the String instead of integer.

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

提交回复
热议问题