HtmlForgeX

API Reference

Class

EmailBody

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email

Represents the body section of an email document with table-based layout for email client compatibility.

Inheritance

Constructors

public EmailBody(Email email) #

Initializes a new instance of the EmailBody class.

Parameters

email HtmlForgeX.Email.Email requiredposition: 0
The parent email document.

Methods

Add(HtmlForgeX.Email.Element element) #

Adds an element to the email body.

Parameters

element HtmlForgeX.Email.Element required
The element to add.

Returns

The EmailBody object, allowing for method chaining.

public String GetThemeBackgroundColor() #
Returns: String

Gets the appropriate background color based on theme mode.

RegisterLibraries() #

Registers required libraries for EmailBody.

public override String ToString() #
Returns: String

Converts the EmailBody object to a string that represents the body section of an email document.

Returns

A string that represents the body section of an email document.

WithBackground 2 overloads
public EmailBody WithBackground(RGBColor color) #
Returns: EmailBody

Sets the background color of the email body.

Parameters

color System.String requiredposition: 0
The background color.

Returns

The EmailBody object, allowing for method chaining.

WithBackground(HtmlForgeX.Email.RGBColor color) #

Sets the background color of the email body.

Parameters

color HtmlForgeX.Email.RGBColor required
The background color.

Returns

The EmailBody object, allowing for method chaining.

Properties

public String BackgroundColor { get; set; } #

Gets or sets the background color of the email body.

public Int32 MaxWidth { get; set; } #

Gets or sets the maximum width of the email content.

public String PreheaderText { get; set; } #

Gets or sets the preheader text.

public Boolean IncludePreheader { get; set; } #

Gets or sets whether to include preheader text.