SMTPit_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 Type
- Text
- Format
- SMTPit_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".)
- 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.)
- UseCSS
- Related Items
- SMTPit_SetBody, SMTPit_SetBodyFooter, SMTPit_SetBodyHeader
- Examples
Example 1
Code:
SMTPit_StyledTextToHTML("databasename::fieldname")Result:
Will convert the styled text in the databasename::fieldname field using the old style tag method.Example 2
Code:
SMTPit_StyledTextToHTML("databasename::fieldname"; True )Result:
Will convert the styled text in the databasename::fieldname field using the CSS method.Example 3
Code:
SMTPit_StyledTextToHTML("databasename::fieldname"; False )Result:
Will convert the styled text in the databasename::fieldname field using the old style tag method.Example 4
Code:
SMTPit_StyledTextToHTML("databasename::fieldname"; False ; True )Result:
Will convert the styled text in the databasename::fieldname field using the old style tag method and encode angle brackets.Example 5
Code:
SMTPit_StyledTextToHTML("databasename::fieldname"; False ; False ;"Size")Result:
Will convert the styled text in the databasename::fieldname field using the old style tag method, and will ignore any font sizes.Example 6
Code:
SMTPit_StyledTextToHTML("databasename::fieldname"; True ; False ;"Size¶Color")Result:
Will convert the styled text in the databasename::fieldname field using the CSS method, and will ignore font size and color.