This example demonstrates how to refer to DOS environment variables within message bodies so that the values held in the environment variables can be "expanded" into the message bodies on-the-fly.
This technique could conceivably work anywhere in the NetMailBot batch file, as long as the resulting values after "expansion" make sense within the NetMailBot command line.
NOTE: This also works directly on the command line.
Using this feature requires familiarity with DOS environment variables.
Prepared Example Files
The archive contains one file:
Batch File Contents
This is the content of the batch file:
netmailbot -to email@example.com -from firstname.lastname@example.org -subject "Expanding Environment Variables on %date%" -server localhost -logfile c:\tmp\log.txt -body "This message was sent on %date% at %time%."
D:\EnvVarExpansion>netmailbot -to email@example.com -from firstname.lastname@example.org -subject "Expanding Environment Variables Demonstration" -server mysmtp
.mycomp.net -logfile c:\tmp\log.txt -body "This message was sent on Sun 07/25/2004 at 15:59:52.32."