Three ready-to run examples are provided in the folder \FaxFacts\Samples\MHTML. The example FS files include $email_text and $email_alttext commands to include the body of the e-mail in the FS file itself. Though this is a perfectly valid usage, it is more normal for text/plain and text/HTML parts to be loaded from external files using $email_body and/or $email_altbody commands.
Test 1 - HTML only
This test shows an HTML-only e-mail, where the HTML code is the only 'body' content:
; MHTML Test FS file #1
;
; Edit this file to set a target $email_address and a source
; envelope-sender and from address, and then copy the file
; to an active TOSEND folder
;
; You may also need to select a suitable user profile
$email_address changeme@changeme.com
$email_esender changeme@changeme.com
$email_from changeme@changeme.com
$fax_user @FFUSER\email.usr
$email_subject "Test #1 of simple MHTML e-mail"
; Note that the doubled quotes ("") in the commands below are not
; needed if you use an $email_body command to load the body from
; an external file.
$email_text "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 3.2//EN"">"
$email_text "<HTML>"
$email_text "<HEAD><TITLE>Test message no. 1</TITLE>"
$email_text "</HEAD>"
$email_text "<BODY>"
$email_text "<H1>This is test message no. 1</H1>"
$email_text "<H2>Here comes the red test image:</H2>"
$email_text "<IMG SRC=""cid:image1.`EM_MSGID"" BORDER=0 HEIGHT=32 WIDTH=117"
$email_text "ALT=""red test image"">"
$email_text "<H2>Here comes the yellow test image:</H2>
$email_text "<IMG SRC=""cid:image2.`EM_MSGID"" BORDER=0 HEIGHT=32 WIDTH=152"
$email_text "ALT=""yellow test image"">
$email_text "<P>This is the last line of this test message."
$email_text "</BODY></HTML>"
$email_attach "`FFBASE\Samples\MHTML\red-test-image.gif" "EMBEDDED:image/gif"
$email_attach "`FFBASE\Samples\MHTML\yellow-test-image.gif" "EMBEDDED:image/gif"
Test 2 - Text/plain and Text/HTML
This test adds a plaintext component with the HTML moved to the alternate body content:
; MHTML Test FS file #2
;
; Edit this file to set a target $email_address and a source
; envelope-sender and from address, and then copy the file
; to an active TOSEND folder
;
; You may also need to select a suitable user profile
$email_address changeme@changeme.com
$email_esender changeme@changeme.com
$email_from changeme@changeme.com
$fax_user @FFUSER\email.usr
$email_subject "Test #2 of simple MHTML e-mail"
$email_text "Text displayed to non-HTML-capable mail clients"
; Note that the doubled quotes ("") in the commands below are not
; needed if you use an $email_altbody command to load the body from
; an external file.
$email_alttext "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 3.2//EN"">"
$email_alttext "<HTML>"
$email_alttext "<HEAD><TITLE>Test message no. 2</TITLE>"
$email_alttext "</HEAD>"
$email_alttext "<BODY>"
$email_alttext "<H1>This is test message no. 2</H1>"
$email_alttext "<H2>Here comes the red test image:</H2>"
$email_alttext "<IMG SRC=""cid:image1.`EM_MSGID"" BORDER=0 HEIGHT=32 WIDTH=117"
$email_alttext "ALT=""red test image"">"
$email_alttext "<H2>Here comes the yellow test image:</H2>
$email_alttext "<IMG SRC=""cid:image2.`EM_MSGID"" BORDER=0 HEIGHT=32 WIDTH=152"
$email_alttext "ALT=""yellow test image"">
$email_alttext "<P>This is the last line of this test message."
$email_alttext "</BODY></HTML>"
$email_attach "`FFBASE\Samples\MHTML\red-test-image.gif" "EMBEDDED:image/gif"
$email_attach "`FFBASE\Samples\MHTML\yellow-test-image.gif" "EMBEDDED:image/gif"
Test 3 - Text/plain and Text/HTML and TIF attachment
This test adds a non-embedded TIF image, as would happen in a fax-to-email application which sends a thumbnail along with the actual received fax file:
; MHTML Test FS file #3
;
; Edit this file to set a target $email_address and a source
; envelope-sender and from address, and then copy the file
; to an active TOSEND folder
;
; You may also need to select a suitable user profile
$email_address changeme@changeme.com
$email_esender changeme@changeme.com
$email_from changeme@changeme.com
$fax_user @FFUSER\email.usr
$email_subject "Test #3 of simple MHTML e-mail"
$email_text "Text displayed to non-HTML-capable mail clients"
; Note that the doubled quotes ("") in the commands below are not
; needed if you use an $email_altbody command to load the body from
; an external file.
$email_alttext "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 3.2//EN"">"
$email_alttext "<HTML>"
$email_alttext "<HEAD><TITLE>Test message no. 3</TITLE>"
$email_alttext "</HEAD>"
$email_alttext "<BODY>"
$email_alttext "<H1>This is test message no. 3</H1>"
$email_alttext "<H2>Here comes the red test image:</H2>"
$email_alttext "<IMG SRC=""cid:image1.`EM_MSGID"" BORDER=0 HEIGHT=32 WIDTH=117"
$email_alttext "ALT=""red test image"">"
$email_alttext "<H2>Here comes the yellow test image:</H2>
$email_alttext "<IMG SRC=""cid:image2.`EM_MSGID"" BORDER=0 HEIGHT=32 WIDTH=152"
$email_alttext "ALT=""yellow test image"">
$email_alttext "<P>This is the last line of this test message."
$email_alttext "</BODY></HTML>"
$email_attach "`FFBASE\Samples\MHTML\red-test-image.gif" "EMBEDDED:image/gif"
$email_attach "`FFBASE\Samples\MHTML\yellow-test-image.gif" "EMBEDDED:image/gif"
$email_attach "`FFBASE\DEMOIMG\SAMPLE Letter High.TIF" "image/tif"
See Sending MHTML E-Mail for more information.
Topic url: http://www.copia.com/support/refmanual/index.html?mhtml_e_mail.htm