-bodyfile (-bf)
Previous Topic  Next Topic 

Category:

 

Message Content

 

Description: 

 

Filename of file to be used as the body of the message.

 

Optional?

 

Yes.

 

Overrides:

 

-body (when -bodyfile points to an HTML file on a website)

 

Overridden By:

 

None.

 

Other Parameters Required:

 

-to -from -server

 

See Also:

 

-body

 

Usage:

 

-bodyfile "<path to body file>"

 

Examples (cut-and-paste right into your batch file):

 

Example #1: The file C:\tmp\text.txt is loaded as the body of the email. The message body will appear as plain text due to the file extension .txt.

 

NetMailBot -bodyfile "C:\tmp\text.txt" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

 

Example #2: The file C:\tmp\rich.html is loaded as the body of the email. The message body will appear as HTML due to the file extension .html. 

 

NetMailBot -bodyfile "C:\tmp\rich.html" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test" 

 

Example #3: The website http://www.ExclamationSoft.com is loaded as the body of the email and will appear as HTML in the recipient's email client. 

 

NetMailBot -bodyfile "http://www.ExclamationSoft.com" -to email@domain.com -from email@domain.com -server mail.domain.com -subject "test"

 

Comments:

 

The intention is to use either -body or -bodyfile. However, -body acts additively with -bodyfile, so you could use both together, but the contents of the specified body file will be appended to whatever is specified in -body. Suppose the two parameters are used together in a NetMailBot invocation as:

 

... -body "Here is an inline message body" -bodyfile "C:\bodyfile.txt" ...

 

Suppose the content of bodyfile.txt is simply "One line in a bodyfile". Then the message will be received with the following body:

 

"Here is an inline message bodyOne line in a bodyfile"

 

However, this does not apply if -bodyfile references an HTML file on a website (-bodyfile "http://www.something.com"). In this case, only the HTML file will be included as the message body.

 

If -bodyfile refers to a locally stored HTML file, the body will consist of the text from -body followed by the HTML file, but the results may appear strange.

 

Therefore, we recommend using -body or -bodyfile, but not both at the same time.