我有一个每晚运行的批处理作业,可以判断它是否失败。当它失败时,我想让它发送一封电子邮件,可能带有附件。
如何从Windows批处理(.bat)文件发送电子邮件?
我有一个每晚运行的批处理作业,可以判断它是否失败。当它失败时,我想让它发送一封电子邮件,可能带有附件。
如何从Windows批处理(.bat)文件发送电子邮件?
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