Batch generated e-mail messages were mentioned before in my Solutions found in alt.msdos.batch page.

The January 2000 issue of Blaise, the Dutch HCC Pascal User Group's magazine, contained an article about sending e-mail with Delphi. The article contained more information on the command strings used to send e-mail.

Notes: (1) All parameters mentioned need to be "escaped", i.e. spaces should be replaced by %20, carriage return/line feeds by %0D%0A, double quotes by %22, single quotes by %27, backslashes by %5C, less than by &lt;, greater than by &gt;, and ampersands by &amp;.
For batch files and command line use, unless the entire string is enclosed in doublequotes, the percent signs in the "escape sequences" themselves must also be replaced by double percent signs: so in the end spaces should be replaced by %%20, carriage return/line feeds by %%0D%%0A, etcetera.
(2) The commands shown here only create a message.
To send it you still need to press the Send button yourself.
Check out the links to third party command line e-mail utilities at the bottom of this page if you need to send e-mail unattended.

START mailto:dummy@nuldevice.com?subject=Test%%20messageˆ&cc=info@nuldevice.comˆ&body=Hi,%%0D%%0A%%0D%%0AThis%%20is%%20an%%20automatically%%20created%%20message.%%0D%%0A%%0D%%0ABye
This command will create a message to dummy@nuldevice.com, with a carbon copy to info@nuldevice.com, with the words "Test message" in the subject field.
The message itself will consist of the following text:

Hi,

This is an automatically created message.

Bye

The following NT only batch file will check if the correct network drive mappings have been made.
If not, an e-mail message to the helpdesk is generated (assuming the e-mail software is available without the mappings). The user can add more information before actually sending it.

:Mail
FOR /F "TOKENS=2*" %%A IN ('DATE/T') DO SET DATE=%%A
FOR /F %%A IN ('TIME/T') DO SET TIME=%%A
START mailto:helpdesk@ourdomain.com?subject=Drive%%20mapping%%20errorˆ&body=At%%20%DATE%,%%20%TIME%,%%20user%%20%USERNAME%%%20encountered%%20the%%20following%%20drive%%20mapping%%20error(s)%%20on%%20%COMPUTERNAME%:%%0D%%0A%BODY%
GOTO :EOF