Free Support Forum - aspose.com

The operation ‘Connect’ terminated. Timeout has been reached

Hello,

I was using aspose-email-19.10-jdk16.jar. I got exception “The operation ‘Connect’ terminated. Timeout has been reached.” from time to time.

I saw a similar post TimeoutException: The operation ‘Connect’ terminated. Timeout ‘100000’ has been reached on sending or receiving emails.
So I upgraded the jar to latest version aspose-email-20.4-jdk16.jar. However I am still having the same exception after changing the jar.

Could you please look into the issue?

Thanks,
Roland

@rolandluo,

In the issue mentioned by you, we suggested to use new implementation of SocketsLayer to connect server:

//enable TLS1.2 support with Sockets Layer version 2
EmailClient.setSocketsLayerVersion2(true);

//open connection
SmtpClient client = new SmtpClient("host.com", 587, "user", "pass");
client.noop();

Have you tried that on your end. If there is still an issue after this, please share the working sample code along with test account credentials with us.

@mudassir.fayyaz,

We used imapclient because we only need to read email.

Implementation is as follows:

EmailClient.setSocketsLayerVersion2(true);
imapClient = new ImapClient();
imapClient.setHost(emailHost);
imapClient.setPort(imapClientPort);
imapClient.setUsername(userID);
imapClient.setPassword(password);
imapClient.setSecurityOptions(SecurityOptions.Auto);
imapClient.setTimeout(imapClientTimeout);
imapClient.selectFolder(sourceMailFolder);

Do you think the implemenation is OK or I need to try another implemetation

@rolandluo

Please share the test account credentials and host information to verify the issue on our end.

@mudassir.fayyaz
Can you elaborate on the test account credentials? What information do you need and on which platform? Can you also share a contact email where I can send it to?

@rolandluo.

I request you to please provide following information so that I may verify the issue on my end,