Jump to content

[Solved] Could Not Connect To Smtp Host Smtp.google.com, Port:587


Recommended Posts

Posted

I am creating a mailing system in java web application, using google SMTP .

 

but it shows this:

 

HTTP Status 500 - javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

type Exception report

message javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.RuntimeException: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
nested exception is:
java.net.ConnectException: Connection refused (Connection refused)
com.SendVerification.SendMail(SendVerification.java:50)
com.Register.doPost(Register.java:72)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
nested exception is:
java.net.ConnectException: Connection refused (Connection refused)
com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961)
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
javax.mail.Service.connect(Service.java:317)
javax.mail.Service.connect(Service.java:176)
javax.mail.Service.connect(Service.java:125)
javax.mail.Transport.send0(Transport.java:253)
javax.mail.Transport.send(Transport.java:124)
com.SendVerification.SendMail(SendVerification.java:45)
com.Register.doPost(Register.java:72)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.net.ConnectException: Connection refused (Connection refused)
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
java.net.Socket.connect(Socket.java:589)
java.net.Socket.connect(Socket.java:538)
com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:299)
com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:234)
com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
javax.mail.Service.connect(Service.java:317)
javax.mail.Service.connect(Service.java:176)
javax.mail.Service.connect(Service.java:125)
javax.mail.Transport.send0(Transport.java:253)
javax.mail.Transport.send(Transport.java:124)
com.SendVerification.SendMail(SendVerification.java:45)
com.Register.doPost(Register.java:72)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note The full stack trace of the root cause is available in the Apache Tomcat/8.5.4 logs.

please help.....

 

 

Posted

I just tested the outbound port 587 connection to 173.194.202.108 and 173.194.202.109 from Tommy and they both work. Does it help if you specify the IP directly?

Posted

I just tested the outbound port 587 connection to 173.194.202.108 and 173.194.202.109 from Tommy and they both work. Does it help if you specify the IP directly?

He needs to enable unsecure application logins in his security settings. This is not a problem with heliohost or Google domains.

Posted

I am creating a mailing system in java web application, using google SMTP .

 

I also tried ip : 173.194.202.108 and 173.194.202.109.

This two are also not working...

Showing same problem...

 

But all this are working in my pc localhost

 

but it shows this:

 

HTTP Status 500 - javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

 

type Exception report

message javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

description The server encountered an internal error that prevented it from fulfilling this request.

exception

 

java.lang.RuntimeException: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

nested exception is:

java.net.ConnectException: Connection refused (Connection refused)

com.SendVerification.SendMail(SendVerification.java:50)

com.Register.doPost(Register.java:72)

javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;

nested exception is:

java.net.ConnectException: Connection refused (Connection refused)

com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961)

com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)

javax.mail.Service.connect(Service.java:317)

javax.mail.Service.connect(Service.java:176)

javax.mail.Service.connect(Service.java:125)

javax.mail.Transport.send0(Transport.java:253)

javax.mail.Transport.send(Transport.java:124)

com.SendVerification.SendMail(SendVerification.java:45)

com.Register.doPost(Register.java:72)

javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.net.ConnectException: Connection refused (Connection refused)

java.net.PlainSocketImpl.socketConnect(Native Method)

java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

java.net.Socket.connect(Socket.java:589)

java.net.Socket.connect(Socket.java:538)

com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:299)

com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:234)

com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)

com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)

javax.mail.Service.connect(Service.java:317)

javax.mail.Service.connect(Service.java:176)

javax.mail.Service.connect(Service.java:125)

javax.mail.Transport.send0(Transport.java:253)

javax.mail.Transport.send(Transport.java:124)

com.SendVerification.SendMail(SendVerification.java:45)

com.Register.doPost(Register.java:72)

javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note The full stack trace of the root cause is available in the Apache Tomcat/8.5.4 logs.

 

 

please help.....

Posted

Dear Admin,

 

Ip :173.194.202.108 or 173.194.202.109 are also not working in my heliohost tommy server, but it works in my pc's localhost server.

Please help....

Posted

I wonder if it being a Java application has something to do with it. I know theres a way to do this since Ive seen it done with non-Java software.

 

Escalating so Krydos can take a deeper look.

Guest
This topic is now closed to further replies.
×
×
  • Create New...