Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a free command-line-based, lightweight SMTP server for Windows?

All I'm looking for is the ability to send HTML emails from the command-line, using a standalone EXE, with the program being its own server (rather than using some other server like Gmail).

By "lightweight" I mean there should be a single executable, or -- if not possible -- it should come with at most a handful of supporting DLLs, and run standalone (i.e. without installing anything).


  • I am not looking for hMailServer. It may be awesome, but it's still bloated for sending a single email. I just need a command-line tool I can have handy on a flash drive or a recovery environment -- something that does not require installation.

  • The server needs to support TLS -- i.e., it should be able to send mail to major providers like Gmail, which require encryption.

  • IIS fails every test: it's (1) not lightweight and (2) not standalone.

For those who claim Gmail doesn't need encryption:

$ telnet 25
Connected to
Escape character is '^]'.
220 ESMTP a9sm264065ibi.26
250 at your service
530 5.7.0 Must issue a STARTTLS command first. a9sm264065ibi.26

What am I doing wrong?

share|improve this question
GMail doesn't require TLS or any type of encryption for SMTP. (I just confirmed this by making a raw connection with PuTTY on TCP port 25 and manually sent a message to myself without only four commands, none of which involved any encryption.) – Randolf Richardson Aug 17 '11 at 4:32
@Randolf: What were the commands? Each time I tried, it told me I have to use TLS... – Mehrdad Aug 17 '11 at 4:38
Standard SMTP commands -- HELO, MAIL FROM, RCPT TO, DATA (QUIT is outside of that because a successful return code following a properly completed DATA command is all that's required to send a message; using QUIT to end the session is still important though). – Randolf Richardson Aug 17 '11 at 4:50
@Randolph: :O OMG, it worked! So it was an issue with the server... interesting, thanks a lot for the info. But how do you figure out which server you need to connect to, when all you have is the email address the user gives you? Is there a way to look it up with DNS or something? Thanks! – Mehrdad Aug 17 '11 at 6:25
@Randolph: Interesting, thanks a lot for the info; that's really helpful! (BTW, my emails went to spam, lol...) – Mehrdad Aug 17 '11 at 6:50
up vote 2 down vote accepted

I use Blat to send mails from the command line and have also used this in programs to send mail as well. It is a single executable.

enter image description here

share|improve this answer
I just tried it with blat Email.txt -to -server -f my_email and I got Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19) Sending Email.txt to Login name is my_email The SMTP server does not like the sender name. Have you set your mail address correctly? – Mehrdad Aug 17 '11 at 4:43
Right, gmail needs SSL. For this I use another light program called stunnel You set up stunnel to run on a local port, say 2099, and then tell blat to send to Not pretty, but still lightweight and it works. I even used this stunnel trick to get Sharepoint to send to gmail accounts. Good luck! – Daniel Williams Aug 17 '11 at 4:50
The only problem with "blat" is that it doesn't perform its own DNS lookups for MX records -- you have to specify the server. +1 because this is a good solution otherwise though (and there are dozens of alternatives, all of which don't seem to perform their own MX record lookups). – Randolf Richardson Aug 17 '11 at 4:52
Is this a server? "What is Blat (and what does it do)? "What is Blat (and what does it do)? Blat is a small, efficent SMTP command line mailer for Windows. It is the SMTP sending part of an eMail User Agent (MUA) or eMail client. As such, Blat sends eMail via SMTP (or internet eMail) from the command line, or CGI, ..." <-- looks like not a server. – barlop Sep 15 '14 at 16:56
And regarding the -install option. from the same page "CL - Why should I run Blat -install...? Because it simplifies the command line by storing any or all of the following in the registry SMTP Server Address Sender's Address " <-- So looks like that option doesn't make it a server. – barlop Sep 15 '14 at 16:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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