Problem with imap

Hi Dears

when I recive my mails via imap the resault like this picture

Hi Masoud,


Thanks for writing to Aspose.Email support team.

I am afraid to inform that I could not re-produce the issue here. Please make it sure that latest version of Aspose.Email for .NET 2.6.0 is used for the testing .

Could you please send us the console application with your sample code to extract mails from the Imap server along with Imap server detail.

Thanks in advance for your cooperation.


hi
Thanks for your attention. i download latest version but the problem still exist

Hi Masoud,

Thanks for providing the sample application.

I have tried to re-produce the issue using your application but due to unavailability of account credentials I could not succeed. For further analysis I tried this scenario using my test account credentials and found the following sample code working fine.

ImapClient client = new ImapClient(“[imap.gmail.com](http://imap.gmail.com/)”, 993, "user@gmail.com", “password”);
// set the security mode to explicit
client.SecurityMode = ImapSslSecurityMode.Implicit;
// enable SSL
client.EnableSsl = true;
//ImapClient client = new ImapClient(“[mail.famnegar.com](http://mail.famnegar.com/)”, 143, "fatemi@famnegar.com", “password”);
try
{
System.Console.WriteLine(“Connecting to the Imap server”);
client.Connect();
System.Console.WriteLine(“Connected to the Imap server”);

//login to the remote server.
client.Login();
System.Console.WriteLine(“Logged in to the Imap server”);
}
catch (Exception ex)
{
System.Console.Write(ex.ToString());
}
// select the inbox folder
client.SelectFolder(ImapFolderInfo.InBox);
// get the message info collection
ImapMessageInfoCollection list = client.ListMessages();
// download each message
for (int i = 0; i < list.Count; i++)
{
MailMessage mail = client.FetchMessage(list[i].SequenceNumber);
Console.WriteLine(“Sequence#:” + list[i].SequenceNumber);
Console.WriteLine(“Sender:” + mail.From);
Console.WriteLine(“Subject:” + mail.Subject);
Console.WriteLine(“Date:” + mail.Date);
Console.WriteLine("__________________");
}
//Disconnect to the remote Imap server
client.Disconnect();
System.Console.WriteLine(“Disconncect to the Imap server”);

Could you please embed above code in some console application and let us know your feedback. This will help us to identify the problem and assist you as soon as possible.

thanks alot. this way solve my problem.

Hi Masoud,


We are glad to know that your issue is resolved. Please feel free to write us back if you have any other query related to Aspose.Email for .NET.