this is code
var _DB = new DBContext(@“data source=(localdb)\MSSQLLocalDB;initial catalog=dbtsyncxx; integrated security=True ;”);
ProjectEntity Pro = _DB.Projects
.Include(Q => Q.MigrationConfig)
.Include(Q => Q.Users.Select(u => u.MailFolders.Select(mf => mf.MailMessages)))
.Include(Q => Q.UserFolderMappings).Include(q => q.Users.Select(u => u.UserFolderMappings))
.Include(Q => Q.SourceEndPoint)
.Include(Q => Q.TargetEndPoint).First();
Aspose.Email.Clients.Imap.ImapClient ImapClient = new Aspose.Email.Clients.Imap.ImapClient
{
Host = “”,
Username = “”,
Password = “”,
Port = 993,
Timeout = 60 * 60 * 1000
};
// Aspose.Email.Clients.IConnection com = ImapClient.CreateConnection(true);
foreach (MigrationToolBox.DBContext.Entity.MailFolderEntity item in Pro.Users[0].MailFolders)
{
foreach (MailMessageEntity itmaiem in item.MailMessages)
{
Task.Run(() =>
{
try
{
MailMessage xx = ImapClient.FetchMessage(itmaiem.UniqueID);
}
catch (Exception ex )
{
}
});
}
}
Console.Read();
Aspose.Email version=20.12.0
with this code i got error Exception system.invalidoperationexception in aspose.mail.dll Message : “{08DA9AE2-B333-4C77-A7E3-070F23627822}:114”
if i set UseMultiConnection = Aspose.Email.Clients.MultiConnectionMode.Enable and use another connection (what ever CreateConnection(true/fasle )) for fetchmessage i got the same error
how can i fetch message with multithreading