unattended e-mail sending

  • Thread starter Thread starter BigMan
  • Start date Start date
B

BigMan

How, if possible, does one write a console (command prompt) script to send
e-mail with an attachment using software that ships with Windows XP Pro
only?
 
BigMan said:
How, if possible, does one write a console (command prompt) script to send
e-mail with an attachment using software that ships with Windows XP Pro
only?
Hi

It does not exist any command line tools builtin for this.

You can create a VBScript though, and let it accept command line
parameters so you can call it from a command line/batch file,
something like this:

cscript.exe SendEmail.vbs "parameter 1" "parameter 2" "parameter 2"


How do I send e-mail with CDO?
http://www.aspfaq.com/show.asp?id=2026

Note the sometimes-needed requirement to fill in the smtp server name:
http://groups.google.com/groups?threadm=#[email protected]


Some CDO info here as well:

Sending mail from Excel with CDO
http://www.rondebruin.nl/cdo.htm


An alternative is to use a 3rd party command line tool for this:

Blat (free)
http://www.blat.net/194/

A Google newsgroup search:
http://groups.google.com/groups?as_q=blat&as_ugroup=*.scripting
 
Hello, BigMan:
On Wed, 1 Dec 2004 09:55:08 +0200: you wrote...

B> How, if possible, does one write a console (command prompt) script to
B> send e-mail with an attachment using software that ships with Windows XP
B> Pro only?
B>

Using VBScript and CDO, IIS SMTP service runnig on localhost...

'SampleSend.vbs
'Sending a text email with an attached file
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.Sender = "(e-mail address removed)"
objMessage.To = "(e-mail address removed)"
objMessage.TextBody = "This is some sample message text."
objMessage.AddAttachment "c:\temp\readme.txt"
objMessage.Send

For other examples including using a remote server with authentication
http://www.paulsadowski.com/WSH/cdo.htm

Regards, Paul R. Sadowski [MVP].
 
Back
Top