Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

marked as duplicate by Diago 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.

    
    
Lots of options here. Much appreciated DHayes. –  Wagnarock Nov 5 '09 at 20:23

3 Answers 3

up vote 5 down vote accepted

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.

share|improve this answer
    
This looks like it would work. Thanks John –  Wagnarock Nov 5 '09 at 20:18
    
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.

share|improve this answer
    
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.
Example:

Send-MailMessage –From me@myDomain.com –To you@Yourdomain.com –Subject   
"Test Email" –Body "Testing the cmdlet" –SmtpServer smtp.mydomain.com
share|improve this answer
    
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.