MailMessage.GetHtmlBodyText
Contents
[
Hide
]GetHtmlBodyText(bool)
Gets the message html body as plain text. This method parses the HtmlBody property and returns plain text content ignoring the html markup.
public virtual string GetHtmlBodyText(bool showUrl)
Parameter | Type | Description |
---|---|---|
showUrl | Boolean | Defines need to show URL in text. |
Examples
The following example shows how to get an email message�s HTML body as plain text.
[C#]
var eml = MailMessage.Load("HtmlWithUrlSample.eml");
var bodyWithUrl = eml.GetHtmlBodyText(true);// body will contain URL
var bodyWithoutUrl = eml.GetHtmlBodyText(false);// body will not contain URL
Console.WriteLine($@"Body with URL: {bodyWithUrl}");
Console.WriteLine($@"Body without URL: {bodyWithoutUrl}");
[Visual Basic]
Dim eml = MailMessage.Load("HtmlWithUrlSample.eml")
Dim bodyWithUrl = eml.GetHtmlBodyText(True)
Dim bodyWithoutUrl = eml.GetHtmlBodyText(False)
Console.WriteLine($"Body with URL: {bodyWithUrl}")
Console.WriteLine($"Body without URL: {bodyWithoutUrl}")
See Also
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email
GetHtmlBodyText(HyperlinkRenderingCallback)
Gets the message htmlbody as plain text.
public virtual string GetHtmlBodyText(HyperlinkRenderingCallback hyperlinkRenderingCallback)
Parameter | Type | Description |
---|---|---|
hyperlinkRenderingCallback | HyperlinkRenderingCallback | Reference to custom method for handling rendering of hyperlink. |
Return Value
Result string of custom handling rendering of hyperlink.
See Also
- delegate HyperlinkRenderingCallback
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email