S22.Imap
S22.Imap copied to clipboard
GetMessage(), the "text/html" body part need have a high priority
Sorry my English…… GetMessage(), if i got two body part,I want to get the html part.But,When the first part is plain....i'll can not get the html part.
I came here for this same issue. I just started researching so it's possible there is a way to get the HTML part already
Hello, I found a method to get the body in html of the messages, try this:
foreach (var currentEmail in imap.GetMessages(uids))
{
var currentEmailBody = string.Empty;
using (var reader = new StreamReader(currentEmail.AlternateViews.FirstOrDefault().ContentStream))
{
currentEmailBody = reader.ReadToEnd();
}
}
Thank you @viniciusdemorais. It worked very well.
Thanks @viniciusdemorais. that works