We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

POP3: Invalid credentials error does not create proper error

Hi There,

I am using Aspose.Email v21.04.
When wrong credentials was sent I get “Operation has been canceled” error. No inner exception provided.
How can I define that wrong credentials was sent?
Code example

Pop3Client client = new Pop3Client();
client.Host = m_ServerHost;
client.Username = UserName;
client.Password = Password;
client.Port = Port;
client.SecurityOptions = SecurityOptions.SSLAuto;
try
                {
                    int msgCount = client.GetMessageCount();
                }
                catch (Exception e)
                {
                    message = e.Message;
                }

@Orenk9,
Unfortunately, I have not managed to reproduce the “Operation has been canceled” error with the wrong credentials on my side. I changed the host, user name, password and port to incorrect values separately and it did not help to cause that error. Could you please share some additional information about how to do this?

Additional data

Pop3Client client = new Pop3Client();
client.Host = “[pop.gmail.com](http://pop.gmail.com/)”;
client.Username = UserName; //valid username
client.Password = Password; // not valid password (removed last sign from password)
client.Port = 995;
client.SecurityOptions = SecurityOptions.SSLAuto;
try
{
int msgCount = client.GetMessageCount();
}
catch (Exception e)
{
message = e.Message;
}

Exception:
{"The operation 'Connect' terminated. Timeout '100000' has been reached."}
image.png (61.6 KB)

@Orenk9,
I will answer you as soon as possible.

@Orenk9,
Unfortunately, I have still not managed to reproduce the error you described in the first message. I get the “Unable connect to the server” error only. You should investigate this case on your side and isolate conditions for reproducing the error. As for the “The operation ‘Connect’ terminated. Timeout ‘100000’ has been reached” error, the description is self-explained.