Drealmer's Tumblr

25/04/2011

Gmail SMTP via command line on Windows

My previous attempt (link) at sending emails through Gmail from the command line was a bit cumbersome, so here is a simpler one, by using msmtp (link). You will have to replace [USER], [PASSWORD] and [TO] with appropriate values.

echo "hello world" | msmtp --host=smtp.gmail.com --port=587
--tls=on -f [USER]@gmail.com --tls-certcheck=off
--user=[USER] --passwordeval="echo [PASSWORD]"
--auth=on --debug -- [TO]

I am not sure how to send attachments though.

Tumblr » powered Sid05 » templated
blog comments powered by Disqus