Googled a lot but couldn't find tutorials about how to send emails from Windows command line. After playing with the mail tools in Cygwin, found it's pretty straightforward and put it up here for future reference.
- Install cygwin if you don't have it. (It's handy if you are familiar with the linux toolchain!).
- Install
exim
andemail
. You can both search for it in the searchbox, or expand "mail" item and find them manually. - Run
exim-config
and thenemail-config
in cygwin command line. It's very straightforward to configure. Choose SMTP server, with no authentication, no TLS in theemail-config
.
And that's it. Try echo This is a test email | email -s "test" foo@bar.com
to test.
Update:
- Replace
email
tosendmail
in ubuntu. - This post solves the problem of extremely slow
sendmail
in ubuntu.
Comments