3

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?

2

3 Answers 3

5

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 [email protected]
    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.

2
  • you're very welcome! :)
    – user1931
    Commented Nov 5, 2009 at 20:20
  • Just implemented this and it works perfectly.
    – Wagnarock
    Commented Nov 5, 2009 at 21:08
3

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.

1
  • 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
    Commented Nov 5, 2009 at 21:04
3

powershell 2.0 has a send-mail cmdlet built in.
Example:

Send-MailMessage –From [email protected] –To [email protected] –Subject   
"Test Email" –Body "Testing the cmdlet" –SmtpServer smtp.mydomain.com
1
  • I didn't realize that. I'll definitely have to look at that. Thank you James
    – Wagnarock
    Commented Nov 5, 2009 at 20:19

Not the answer you're looking for? Browse other questions tagged .