GetPlainFromHtml Method


Returns plain-text version of specified HTML string by transforming <br>, <p> and some other tags into their text equivalents and removing all other tags (including <head>...</head> section).

If you need to get plain version of HTML message body, you can obtain it through Message.AltBodyText property.


strPlain = ObjectName.GetPlainFromHtml(Html)  
Parameters:  
Html Source HTML string  
Return value As String Plain-text version of the source  

Usage example:

Dim Msg, strPlain
'Using visual basic to create object
Set Msg = CreateObject("MailBee.Message")
'Using ASP to create object
'Set Msg = Server.CreateObject("MailBee.Message")
'In ASP use Response.Write instead of MsgBox
strPlain = Msg.GetPlainFromHtml("<html>first line<br>second line</html>")
MsgBox strPlain

See Also:

Message Object
AltBodyText Property
GetHtmlFromPlain Method


Copyright © 2002-2022, AfterLogic Corporation. All rights reserved.