I'm trying to get Plain Text or HTML Text of email but I cannot find any documentation and I did not find features such as EmailMessage.BodyText.Text / EmailMessage.BodyHtml.Text or EmailMessage.GetBodyPlainText() / EmailMessage.GetBodyHTMLText()
I developed this C# code to do. What do you think?
IList<Attachment> iList;
string HtmlText = "", PlainText = "";
for (var i = pop3.GetMessageCount() - 1; i >= 0; i--)
{
MailMessage msg = pop3.GetMessage(i);
TextBody = msg.Body;
iList = msg.AlternateViews as IList<Attachment>;
if (iList.Count == 0) iList = msg.Attachments as IList<Attachment>;
if (iList.Count > 0)
{
TextBody = iList[0].Body;
HtmlBody = iList[1].Body;
}
}
I'm trying to get Plain Text or HTML Text of email but I cannot find any documentation and I did not find features such as EmailMessage.BodyText.Text / EmailMessage.BodyHtml.Text or EmailMessage.GetBodyPlainText() / EmailMessage.GetBodyHTMLText()
I developed this C# code to do. What do you think?