Element Constructor (String)
Initializes a new instance of Element object with the specified HTML markup.

Namespace: MailBee.Html
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public Element(
	string htmlText
)

Parameters

htmlText
Type: SystemString
The actual HTML markup of the Element.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionhtmlText is a null reference (Nothing in Visual Basic).
Remarks
htmlText can contain any string including HTML with broken markup, plain text, etc. MailBee will attempt to parse it even if not all tags are closed, or some tags are closed incorrectly, etc.
Examples
This samples initializes Element object with certain HTML markup and then displays the name of the root tag and the inner HTML contents of the specified markup.
// To use the code below, import these namespaces at the top of your code.
using System;
using MailBee.Html;

// The actual code (put it into a method of your class).
Element richText = new Element("<html><head><title>Sample header</title></head><body>Short sample<body></html>");
Console.WriteLine("The root tag name is : " + richText.TagName);
Console.WriteLine("The inner HTML source is : " + richText.InnerHtml);
See Also