开发者

Java Mail Error : java.net.ConnectException: Connection refused: connect

I am stuck with the mail sending with Java Mail API.

I am not able to connect SMTP server with any kind of properties... I have tried with different combination.

I am connecting SMTP Remote server (Server is not at localhost, its in LAN), with port 25 but it gives me the port error to 465, I dont know why ?

javax.mail.Messagi开发者_高级运维ngException: Could not connect to SMTP host: *RemoteIP*, port: 465; nested exception is: java.net.ConnectException: Connection refused: connect 

If anyone can help.

Thankx in advance.


Maybe your mail server is actually using SMTPS on port 465 (although it's not the recommended port). If that is the case you can see here an example of using JavaMail with SMTPS. Note the property mail.smtps.host; you also have the mail.smtps.port property to specify 465.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜