Home » Questions » Computers [ Ask a new question ]

Send email from the command line [duplicate]

Send email from the command line [duplicate]

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?

Asked by: Guest | Views: 203
Total answers/comments: 2
Guest [Entry]

"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© 2002-2004 Craig.Peacock@beyondlogicdotorg
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."
Guest [Entry]

"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"