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,

@mudassir.fayyaz

Unfortunately I cannot share our email server credentials due to our security constraint.

@rolandluo,

In that case, I suggest you to check connection with MS Outlook, then when connect will be succeeded you may use settings which you have used with outlook.

@mudassir.fayyaz,

I am also facing same problem with Aspose.Email.Clients.Imap.ImapClient and I am using Aspose.Email, Version=20.9.1.0.

Let me know what could be the reason.

@marieke.saeij

Can you please check the following suggested option for your kind reference and also try using latest Aspose.Email for .NET 20.10 on your end.