views:

36

answers:

1

I have a batch file in DOS that does some checking and I need to fire off an email when its done. I've found a few solutions on the interwebz but most of them are 3rd party or just simply open up a new message in Outlook. I need the command to send an email in its entirety without any human interaction.

We use MS Exchange here, if that matters.

Thanks!

+2  A: 

Assuming:

  1. Your Exchange server accepts emails via SMTP on port 25.
  2. You want to send a simple text only email without attachments.
  3. It's possible to drive telnet (or a similar telnet client) from a batch file.

You could just send a simple email via Telnet. This link shows an example of how to do it: http://www.yuki-onna.co.uk/email/smtp.html

If assumption 2 or 3 is wrong, you could write a command line SMTP client for sending simples emails fairly easily in many languages and then call it from your batch file.

ho1
Through some poking around, it seems that 3 is incorrect in my scenario. I will create a simple VB6 EXE to handle my emailing.Thanks for your guidance.
Honus Wagner
Its very easy to write a console application in VB.NET that sends emails via SMTP. VB6 might be a little more challenging.
Avalanchis
@Avalanchis @Honus If it's VB6, I remember seeing a free helper dll for that, seems to be called `vbSendMail.dll` and can be found here http://www.freevbcode.com/ShowCode.Asp?ID=109. I have some memory of using it long time ago but not sure so might have been something completely different. Might be worth taking a look at though.
ho1