javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465; nested exception is: java.net.ConnectException: Connection refused

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via blogspot.com by Unknown author, 1 year ago
Could not connect to SMTP host: smtp.gmail.com, port: 465; nested exception is: java.net.ConnectException: Connection refused
via Coderanch by meruva surendra, 10 months ago
Could not connect to SMTP host: smtp.gmail.com, port: 465; nested exception is: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
via Coderanch by meruva surendra, 10 months ago
Could not connect to SMTP host: smtp.gmail.com, port: 465; nested exception is: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
via howtodoinjava.com by Unknown author, 1 year ago
Could not connect to SMTP host: smtp.gmail.com, port: 25, response: 421
via howtodoinjava.com by Unknown author, 1 year ago
Could not connect to SMTP host: smtp.gmail.com, port: 25, response: 421
via Google Groups by ilango g, 2 months ago
Could not connect to SMTP host: smtp.gmail.com, port: 465; nested exception is: java.net.ConnectException: Connection refused: connect
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465; nested exception is: java.net.ConnectException: Connection refused
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1227)
at javax.mail.Service.connect(Service.java:236)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:306)
at com.aa.meals.mail.MealsMailSenderBean.sendMail(MealsMailSenderBean.java:21)
at com.aa.common.log.TestMail.main(TestMail.java:14)

Users with the same issue

769 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Once, 6 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.