Hi Support,
I have updated the DLL to the latest one and now I am getting error "Cannot retrive message in 100ms" at the below line.
Aspose.Email.Mail.MailMessage ProcessMessage = MailClient.FetchMessage(ProcessIndex);
Please Help.
Cheers,
ValuePRO
Hi Support,
I have updated the DLL to the latest one and now I am getting error "Cannot retrive message in 100ms" at the below line.
Aspose.Email.Mail.MailMessage ProcessMessage = MailClient.FetchMessage(ProcessIndex);
Please Help.
Cheers,
ValuePRO
Hi Piers,
Hi Support,
I am using Aspose.Email.Imap.ImapClient
Cheers,
Mani
Hi Piers,
Thank you for the additional information.
I tested this issue at my end using the latest version of Aspose.Email for .NET 2.8.0 and the following code. Unfortunately, I was unable to observe this issue at my end and the code worked well. If you are trying different code than this, I would request you to please provide us with your sample code.
In case the below code sample is what you are trying at your end, I would request you to please provide us with a test account at your server with its credentials, so that we can try to reproduce this issue at our end and provide further assistance.
Sample Code:
Aspose.Email.Imap.ImapClient
imap = new Aspose.Email.Imap.ImapClient(“[imap.gmail.com](http://imap.gmail.com/)”,
993, "username@gmail.com", “password”);
imap.EnableSsl = true; // enable the SSL
imap.SecurityMode = Aspose.Email.Imap.ImapSslSecurityMode.Implicit; // set security mode
imap.Connect(true); // connect and login
// select the Inbox folder
imap.SelectFolder(ImapFolderInfo.InBox);
//gets number of messages in the folder
Console.WriteLine(imap.CurrentFolder.TotalMessageCount + " messages found.");
// get the message info collection
ImapMessageInfoCollection list = imap.ListMessages();
// download each message
for (int i = 0; i < list.Count; i++)
{
Console.WriteLine("Fetching: " + list[i].SequenceNumber);
MailMessage msg = imap.FetchMessage(list[i].SequenceNumber);
}
Hi Support,
Below is the sample code. This was working for the old version DLL and not working for the latest one.
Aspose.Email.Imap.ImapClient MailClient = new Aspose.Email.Imap.ImapClient();
MailClient.Host = Host;
MailClient.Username = Username;
MailClient.Password = Password;
MailClient.Timeout = 100;
bool MailBoxLoginSuccess = false;
for (int i = 0; i < 10; i++)
{
try
{
MailClient.Connect(true);
MailBoxLoginSuccess = true;
break;
}
catch (Exception ex)
{
MailBoxLoginSuccess = false;
}
}
if (!MailBoxLoginSuccess)
{
MailClient = null;
}
else
{
MailClient.SelectFolder(Aspose.Email.Imap.ImapFolderInfo.InBox);
int ProcessStartIndex = 0, ProcessChank = 10, TotalMailCount = MailClient.CurrentFolder.TotalMessageCount;
int ProcessEndIndex = ProcessStartIndex + ProcessChank;
if (TotalMailCount > 0)
{
if (ProcessEndIndex > TotalMailCount)
{
ProcessEndIndex = TotalMailCount;
}
for (int ProcessIndex = 1; ProcessIndex <= ProcessEndIndex; ProcessIndex++)
{
Aspose.Email.Mail.MailMessage ProcessMessage = MailClient.FetchMessage(ProcessIndex);
//other code below
}
}
}
Cheers,
ValuePRO
Hi Piers,
Hi Support,
Could you let me know how to increase the time out.
Cheers,
ValuePRO
Hi Piers,
Please let us know if we can be of any additional help to you.MailClient.Timeout = 1000;