Possible Duplicate:
Windows command line emailer

I am looking for a program that can send an email from the command line, or more specifically from a script. Searching through superuser I've found a lot of Linux solutions but I'd like something which can run in Windows (XP or 2003). I have come across a program called "blat." Has anyone had any positive results with this program? Negative? Or could you offer other suggestions?

marked as duplicate by BinaryMisfit Nov 6 '09 at 5:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


I've never used blat, but I have used bmail. It's very simple, small (17kb) and can easily be used in batch scripts.

C:\>bmail /?

    Command Line SMTP Emailer V1.07
    Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org
    Usage: bmail [options]
            -s    SMTP Server Name
            -p    SMTP Port Number (optional, defaults to 25)
            -t    To: Address
            -f    From: Address
            -b    Text Body of Message (optional)
            -h    Generate Headers
            -a    Subject (optional)
            -m    Filename (optional) Use file as Body of Message
            -c    Prefix above file with CR/LF to separate body from header
            -d    Debug (Show all mail server communications)

bmail is freeware.

  • you're very welcome! :) – John T Nov 5 '09 at 20:20
  • Just implemented this and it works perfectly. – Wagnarock Nov 5 '09 at 21:08

If you're already using Cygwin, or have been considering it anyway, you can use the 'email' package to send e-mail from the Cygwin command-line (or bash script therein).

This three-part Intro-to-Cygwin tutorial includes a quick-start that happens to demonstrate sending email from the Cygwin command-line. Pt1 Pt2 Pt3

And, if it happens to pique your interest, I found that tutorial via this one on setting up an SSH server at home via Cygwin.

  • This certainly has piqued my interest. It may meet another of my needs for a syslog server in Windows. What a bonus. Thanks indeed JMD. – Wagnarock Nov 5 '09 at 21:04

powershell 2.0 has a send-mail cmdlet built in.

Send-MailMessage –From me@myDomain.com –To you@Yourdomain.com –Subject   
"Test Email" –Body "Testing the cmdlet" –SmtpServer smtp.mydomain.com
  • I didn't realize that. I'll definitely have to look at that. Thank you James – Wagnarock Nov 5 '09 at 20:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.