Reputation: 85
I am just trying to send an email form java code. But I am getting exception like this:
"java.lang.RuntimeException: javax.mail.MessagingException:
Could not connect to SMTP host:smtp.gmail.com, port: 465, response: -1."
I have set the following properties:
mail.smtp.host
mail.smtp.socketFactory.port
mail.smtp.auth
mail.smtp.port
What is the reason for this exception?
Please help me. Thanks in advance.
Upvotes: 0
Views: 353
Reputation: 29961
Looks like you haven't found the JavaMail FAQ. These entries might help:
Upvotes: 0
Reputation: 41200
You could probably try this example to sort it out problem -
Upvotes: 1