com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 587; timeout -1; nested exception is: java.net.ConnectException: Connection timed out: connect at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654) at javax.mail.Service.connect(Service.java:345) at javax.mail.Service.connect(Service.java:226) at gmailYeni.SendMail.sendFromGMail(SendMail.java:52) at gmailYeni.SendMail.main(SendMail.java:20) `Caused by: java.net.ConnectException: Connection timed out: connect

  1. 0

    MailConnectException in Java

    Stack Overflow | 3 years ago | Batuhan Bardak
    com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 587; timeout -1; nested exception is: java.net.ConnectException: Connection timed out: connect at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654) at javax.mail.Service.connect(Service.java:345) at javax.mail.Service.connect(Service.java:226) at gmailYeni.SendMail.sendFromGMail(SendMail.java:52) at gmailYeni.SendMail.main(SendMail.java:20) `Caused by: java.net.ConnectException: Connection timed out: connect
  2. 0

    javamail: why IMAPStore.connect switch to port 993 even if mail.imap.ssl.enable=false and port=143?

    Stack Overflow | 1 year ago | francesco marzolo
    com.sun.mail.util.MailConnectException: Couldn't connect to host, port: 172.17.0.247, 993; timeout 5000; nested exception is: java.net.ConnectException: Connection refused: connect
  3. 0

    Mail error

    GitHub | 1 year ago | manjoel
    com.sun.mail.util.MailConnectException: Couldn't connect to host, port: mail.tango.lu, 25; timeout -1;| nested exception is:|?java.net.ConnectException: Die Wartezeit für die Verbindung ist abgelaufen
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    IMAP auth not possible, IMAP service down?

    GitHub | 2 years ago | bluepuma77
    com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 143; timeout 5000

    Root Cause Analysis

    1. com.sun.mail.util.MailConnectException

      Couldn't connect to host, port: smtp.gmail.com, 587; timeout -1; nested exception is: java.net.ConnectException: Connection timed out: connect at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654) at javax.mail.Service.connect(Service.java:345) at javax.mail.Service.connect(Service.java:226) at gmailYeni.SendMail.sendFromGMail(SendMail.java:52) at gmailYeni.SendMail.main(SendMail.java:20) `Caused by: java.net.ConnectException: Connection timed out: connect

      at java.net.TwoStacksPlainSocketImpl.socketConnect()
    2. Java RT
      Socket.connect
      1. java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
      2. java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
      3. java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
      4. java.net.AbstractPlainSocketImpl.connect(Unknown Source)
      5. java.net.PlainSocketImpl.connect(Unknown Source)
      6. java.net.SocksSocketImpl.connect(Unknown Source)
      7. java.net.Socket.connect(Unknown Source)
      8. java.net.Socket.connect(Unknown Source)
      8 frames
    3. JavaMail API (compat)
      SMTPTransport.openServer
      1. com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:297)
      2. com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:229)
      3. com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)
      3 frames