What is the best way to send an email from a batch file?

I have an overnight batch job that can determine if it worked. I want him to send me an email, possibly with the application, when he does.

How to send an email from a Windows batch (.bat) file?

+2
source share
2 answers

If the SMTP server included with IIS is installed, you can use the Echo command to write the file to the pickup folder and it will be sent.

echo From: test@example.com>tmp.txt
echo To: test@example.com>>tmp.txt
echo Subject: hello>>tmp.txt
echo.>>tmp.txt
echo Hello world>>tmp.txt
copy tmp.txt \Inetpub\mailroot\Pickup
+3
source

Blat . Nothing more to say .;)

+4
source

All Articles