SMTPit Pro

Next Generation Email plug-in

<- Back to SMTPit Pro function list

SMTPit_SetBodyWithFile

Description

You can use the SMTPit_SetBodyWithFile function to load a text file into the Plain Text or HTML Body of the email.

Return Type
Text
Format
SMTPit_SetBodyWithFile ( File ; Type ; SMTPit_Append )
Required Parameters
  • File

    The Path and File Name of the File to set as the Text or HTML content for the email.

Optional Parameters
  • Type

    The Content Type; specify "Text" or "HTML". (Default is "Text".)

  • SMTPit_Append

    Leave this in to add this Text or HTML to the end of the current content.

Related Items
SMTPit_SetBody, SMTPit_SetBodyFooter, SMTPit_SetBodyHeader, SMTPit_StyledTextToHTML
Examples

Example 1

Code:

SMTPit_SetBodyWithFile("c:\My Documents\email body.txt")

Result:

Uses the file "email body.txt" for the text body of your email message.

Example 2

Code:

SMTPit_SetBodyWithFile("/Documents/email body.txt")

Result:

Uses the file "email body.txt" for the text body of your email message.

Example 3

Code:

SMTPit_SetBodyWithFile("/Documents/email body2.txt";"Text"; SMTPit_Append )

Result:

Appends the file "email body2.txt" to the text body of your email message.

Example 4

Code:

SMTPit_SetBodyWithFile("c:\My Documents\email body.htm";"HTML")

Result:

Sets the HTML body to the contents of the "email body.htm" file on Windows.

Example 5

Code:

SMTPit_SetBodyWithFile("/Documents/email body.htm";"HTML")

Result:

Sets the HTML body to the contents of the "email body.htm" file on Mac.

Example 6

Code:

SMTPit_SetBodyWithFile("/Documents/email body2.htm";"HTML"; SMTPit_Append )

Result:

Appends the contents of the "email body2.htm" file to the HTML block to on Mac.

Example 7

Code:

SMTPit_SetBodyWithFile("c:\My Documents\email body2.htm";"HTML"; SMTPit_Append )

Result:

Appends the contents of the "email body2.htm" file to the HTML block to on Windows.