You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
}
}
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: