EM_ADD_HTML_TEXT Function
Purpose
Adds an HTML-formatted fragment to appear in the body of the email. This is displayed only if the client receiving the email can display HTML.
The HTML is formatted normally but with these differences:
-
Stylesheets cannot be used; all styling has to be in-line, for example:
<span style="color: red;">...</span>
-
Images are embedded by using the syntax:
<img src="cid:identifier" alt="alternative text" />
Strings with this syntax can be automatically generated by the EM_ADD_ATTACHMENT and EM_ADD_ATTACHMENT_ITEM functions and stored in the named common EM_COMMON variable EM_LINK_DATA so that they can be added to the email body.
Any attribute marks in the HTML are replaced with a carriage return/linefeed sequence.
Syntax
EM_ADD_HTML_TEXT(body-text)
Syntax elements
body-text The HTML formatted text to add to the body of the email.
Returns
None
Comments
The EM_ADD_HTML_TEXT function is intended to be used only once per email.
You must include the item #EM_INCLUDES
in all programs that use the Email API functions; for example, you could add the line
INCLUDE #EM_INCLUDES FROM /SYSFILES/SYS.BASLIB
at the start of the program, or create an item to be automatically included that contains this line.