How to work with multithread for mail.dll? I always get error like this when fetching the data
"Limilabs.Client.ServerException: 'The Write method cannot be called when another write operation is pending.'"
I try to debug and the first method that cause the error
It looks like GetBodyStructureByUID() not build for async, can you help me which method or workaround can be used for running fetch in multi thread?
// Bad code - do not use
await Task.Run(() =>
List<BodyStructure> structures = Imap.GetBodyStructureByUID(NewEmailHeaderIdList);
string text = string.Empty;
string html = string.Empty;
if (structure.Text != null)
text = Imap.GetTextByUID(structure.Text);
if (structure.Html != null)
html = Imap.GetTextByUID(structure.Html);