Purpose
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.
Additional Prerequisites
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 test@exclamationsoft.com -from test@exclamationsoft.com -subject "Expanding Environment Variables on %date%" -server localhost -logfile c:\tmp\log.txt -body "This message was sent on %date% at %time%."
Steps
D:\EnvVarExpansion>EnvVarExpansion
D:\EnvVarExpansion>netmailbot -to joe@test.com -from test@exclamationsoft.com -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."