4AspNet POP3 .NET Component

Attachment.HtmlBody Property

Returns content of attachment if ContentType = "text/html"

[Visual Basic]
Public ReadOnly Property HtmlBody As String
[C#]
public string HtmlBody {get;}

Property Value

Text of attachment if ContentType = "text/html"

Remarks

Returns null if IsFileAttachment = false

Example

This sample shows how to use the HtmlBody property

...
for (int i = 1; i <= objPOP3.TotalMailCount; i++)
{
    EmailMessage objEmail = objPOP3.GetMessage(i, false);
    if (objEmail.IsAnyAttachments)
    {
        for(int a = 0; a < objEmail.Attachments.Count; a++)
        {
            Attachment objFile = (Attachment)objEmail.Attachments[a];
            if (!objFile.IsFileAttachment) 
            {
                if (attFile.HtmlBody != null) 
                    Console.WriteLine("HTML-BODY: " + attFile.HtmlBody);
            }
        }
    }
}
...

See Also

Attachment Class | ForAspNet.POP3 Namespace