Could not connect to SMTP host:, port: 25

Samebug tips10

This might be an issue with the file location in the Spark submit command. Try it with "spark-submit --master spark://master:7077 {file location}"


Check if you've set a name in Application -> Run. If you didn't, the generated XML is gonna have missing information and then this exception will be thrown.


Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web15143

  • via Unknown by Unknown author,
  • Stack trace

    • javax.mail.MessagingException: Could not connect to SMTP host:, port: 25 at com.sun.mail.smtp.SMTPTransport.openServer([mail-1.4.4.jar:1.4.4] at com.sun.mail.smtp.SMTPTransport.protocolConnect([mail-1.4.4.jar:1.4.4] at javax.mail.Service.connect([mail-1.4.4.jar:1.4.4] at javax.mail.Service.connect([mail-1.4.4.jar:1.4.4] at javax.mail.Service.connect([mail-1.4.4.jar:1.4.4] at javax.mail.Transport.send0([mail-1.4.4.jar:1.4.4] at javax.mail.Transport.send([mail-1.4.4.jar:1.4.4] at[exo.kernel.component.common-2.4.7-GA.jar:2.4.7-GA] at[exo.kernel.component.common-2.4.7-GA.jar:2.4.7-GA] at$[forum-forum-service-4.0.4.jar:4.0.4] at java.util.concurrent.ThreadPoolExecutor.runWorker([na:1.7.0_45] at java.util.concurrent.ThreadPoolExecutor$[na:1.7.0_45] at[na:1.7.0_45] Caused by: Couldn't connect using unknown socket factory to host, port:, -1; Exception: java.lang.ClassNotFoundException: ${smtp.socketFactory.class: } at com.sun.mail.util.SocketFetcher.getSocket([mail-1.4.4.jar:1.4.4] at com.sun.mail.smtp.SMTPTransport.openServer([mail-1.4.4.jar:1.4.4] ... 12 more Caused by: java.lang.ClassNotFoundException: ${smtp.socketFactory.class:} at$[na:1.7.0_45] at$[na:1.7.0_45] at Method)[na:1.7.0_45] at[na:1.7.0_45] at java.lang.ClassLoader.loadClass([na:1.7.0_45] at java.lang.ClassLoader.loadClass([na:1.7.0_45] at java.lang.Class.forName0(Native Method)[na:1.7.0_45] at java.lang.Class.forName([na:1.7.0_45] at com.sun.mail.util.SocketFetcher.getSocketFactory([mail-1.4.4.jar:1.4.4] at com.sun.mail.util.SocketFetcher.getSocket([mail-1.4.4.jar:1.4.4] ... 13 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    21 times, last one
    Unknown UserUnknown User
    2 times, last one
    Nikolay RybakNikolay Rybak
    1380 more bugmates