MailMessage.GetHtmlBodyText
Contents
[
Hide
]GetHtmlBodyText(bool)
Gets the text of the HTML body without the markup.
public virtual string GetHtmlBodyText(bool showUrl)
| Parameter | Type | Description |
|---|---|---|
| showUrl | Boolean | true to write the URLs of hyperlinks after their text. |
Return Value
The text of the HTML body.
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 text of the HTML body without the markup, rendering hyperlinks with a custom method.
public virtual string GetHtmlBodyText(HyperlinkRenderingCallback hyperlinkRenderingCallback)
| Parameter | Type | Description |
|---|---|---|
| hyperlinkRenderingCallback | HyperlinkRenderingCallback | The method that renders each hyperlink as text. |
Return Value
The text of the HTML body.
See Also
- delegate HyperlinkRenderingCallback
- class MailMessage
- namespace Aspose.Email
- assembly Aspose.Email