Forum Discussion

N_P's avatar
Occasional Contributor
3 years ago Connection timed out: connect

ERROR: com.sun.mail.util.MailConnectException: Couldn't connect to host, port:, 25; timeout -1;
nested exception is: Connection timed out: connect


Facing above exception while sending mail through adding Send Mail step for test case. Mail is not getting triggered after test step pass of fail. Kindly help to resolve this issue.


3 Replies

  • richie's avatar
    Community Hero
    Hey N_P,

    If youre getting a socketException, the issue is something pretty fundamental....something like wrong TLS/SSL settings or incorrect http/https.

    i.e. are you trying to connect via http when it should be https or the other way round?


    • sonya_m's avatar
      SmartBear Alumni (Retired)

      Thanks Rich!


      Hi N_P! Does the suggestion help? 

      • sonya_m's avatar
        SmartBear Alumni (Retired)

        Hi N_P , looks like you replied to the email notification, so your reply wasn't posted here. Let me quote:



        Thanks Rich. The issue got resolved, I used one groovy script to send Email.

        Thanks for your response.



        Could you share the script with the community, if possible? Thank you!