How do I send an email from a DOS batch command?

52,777

Solution 1

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.

Solution 2

Try

http://sourceforge.net/projects/blat/

it's an open source mailer from SourceForge with a lot of options.

Solution 3

Try http://caspian.dotconf.net/menu/Software/SendEmail/.

It's a third-party utility, but you can easily call it from a batch file. I do. I have the same need that you do: send e-mail at the end of a batch file with no human interaction.

Share:
52,777
Honus Wagner
Author by

Honus Wagner

Blaaarrrrggghhhhh!

Updated on December 31, 2020

Comments

  • Honus Wagner
    Honus Wagner over 3 years

    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!