HtmlForgeX

API Reference

Class

EmailSection

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email

Represents a content section with configurable background and padding. Includes conditional table markup for improved Outlook compatibility.

Inheritance

Constructors

Methods

public override String ToString() #
Returns: String

Converts the section and its children to HTML.

Returns

HTML string representing the section.

public EmailSection WithBackground(String lightColor, String darkColor = null) #
Returns: EmailSection

Sets the background colors for light and optional dark modes.

Parameters

lightColor System.String requiredposition: 0
Color used in light mode.
darkColor System.String = null optionalposition: 1
Optional color used in dark mode. Defaults to the theme's dark surface color.

Returns

The EmailSection instance.

public EmailSection WithMaxWidth(String maxWidth) #
Returns: EmailSection

Sets the maximum width of the inner content table.

Parameters

maxWidth System.String requiredposition: 0
Maximum width (e.g., "600px").

Returns

The EmailSection instance.