I am trying to send mail using java mail api. But exception is come to me wit开发者_高级运维h above message.
Could not connect to SMTP host: {remote-server}, port: {port}, response: -1
What`s mean "response : -1"
I can`t found this code in api manual.
A response code of -1
means that JavaMail failed to get a valid response code from the SMTP server. You can view the relevant source here.
Most likely, you either have your properties set incorrectly or you have a networking issue such as a firewall blocking the connection.
You might try enabling debug mode (session.setDebug(true)
). Please post your code if you need further help.
精彩评论