Product Logo

SMTPit Pro

Next Generation Email plug-in

Functions

SMTPit_StyledTextToHTML

NameSMTPit_StyledTextToHTML
Description

This function will convert styled text to HTML. In other words, you can convert a field that has styled text such as bold, underline, color, font, size, etc. to html and in effect, send HTML email without the end user knowing any HTML.

The styled text can be converted to CSS based HTML or into old style HTML tags. CSS is more precise, however not all email clients will render CSS. It will be up to you as the solution developer to decide which type will fit the needs of your recipients.

Return TypeText
FormatSMTPit_StyledTextToHTML ( FieldName ; UseCSS ; EncodeAngledBrackets ; IgnoreTraits )
Required Parameters
FieldName

The fully qualified Field Name of the Filed that contains the Styled Text. (Note: this must be in quotes, and be in the form “databasename::fieldname”.)

Optional Parameters
UseCSS

Set to True to use CSS or False to use older <font> tags. (Default is False.)

EncodeAngledBrackets

Set to True to encode any angled brackets (‘<’ and ‘>’) found in the field. If you have HTML already in the field, you probably do not want this option. (Default is False.)

IgnoreTraits

Define which traits to ignore. (Use the values ‘Font’, ‘Face’, ‘Size’, ‘Color’. You can define more than one.)

Examples
Example 1

Will convert the styled text in the databasename::fieldname field using the old style tag method.

SMTPit_StyledTextToHTML( "databasename::fieldname" )
Example 2

Will convert the styled text in the databasename::fieldname field using the CSS method.

SMTPit_StyledTextToHTML( "databasename::fieldname" ; True )
Example 3

Will convert the styled text in the databasename::fieldname field using the old style tag method.

SMTPit_StyledTextToHTML( "databasename::fieldname" ; False )
Example 4

Will convert the styled text in the databasename::fieldname field using the old style tag method and encode angle brackets.

SMTPit_StyledTextToHTML( "databasename::fieldname" ; False ; True )
Example 5

Will convert the styled text in the databasename::fieldname field using the old style tag method, and will ignore any font sizes.

SMTPit_StyledTextToHTML( "databasename::fieldname" ; False ; False ; "Size")
Example 6

Will convert the styled text in the databasename::fieldname field using the CSS method, and will ignore font size and color.

SMTPit_StyledTextToHTML( "databasename::fieldname" ; True ; False ; "Size¶Color")