[windows2000] Re: Send email via a batch file...

  • From: "Costanzo, Ray" <rcostanzo@xxxxxxxxxxx>
  • To: <windows2000@xxxxxxxxxxxxx>
  • Date: Thu, 14 Nov 2002 11:49:34 -0500

You can do something like this if the server's running SMTP if you want
to do it PURELY in .bat.

Echo X-Sender: MyServer>%temp%\file.eml
Echo X-Receiver: recipient@xxxxxxxxxx>>%temp%\file.eml
Echo From: MyServer>>%temp%\file.eml
Echo To: recipient@xxxxxxxxxx>>%temp%\file.eml
Echo Subject: Here's an e-mail>>%temp%\file.eml
Echo Content-Type: text/plain;>>%temp%\file.eml
Echo.>>%temp%\file.eml
Echo Here's the body.>>%temp%\file.eml

Move %temp%\file.eml E:\inetpub\mailroot\pickup



Ray at work


> -----Original Message-----
> From: Steve Rance [mailto:Steve.Rance@xxxxxxxxxxxxxxxxxxxxx]=20

>=20
>=20
>=20
> hi,
>=20
> Any ideas how I can send a text file (or contents of) via=20
> email from a =3D
> batch file on a Windows 2000 Server?
>=20
> Basically I have a batch file that generates a log file that I want =3D
> emailed to me on completetion of the script.  and the subject of the =3D
> email to be determined by the errorlevel returned by a=20
> program ran as =3D
> part of the script.
>=20
> Thanks for any ideas,
>=20
> Steve


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


==================================
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm

Other related posts: