Skip to content
A command line tool for sending mail via SMTP and support Linux, Windows, MacOS, BSD etc.
Latest commit 8609bbd Feb 27, 2014 @leopku update homepage



What is SendmailViaSMTP

SendmailViaSMTP is an easy used command line kit for sending mail via smtp server which can use in multiple platforms like linux, BSD, Windows etc. Like msmtp but don't need compile and install in each machine. Just copy to any machine which had python installed. SendmailViaSMTP is distributed under the BSD license.

Where is SendmailViaSMTP


  • Accept data from pipe as email body.
  • Tls support. This means we support sending mail using gmail.
  • Multi recipient support.
  • Multi system supported, like Linux, BSD, Windows etc.
  • NEW: Attachments support(using -a/--attach option, see help message for more).
  • log support. use --log option for debugging.


How to use SendmailViaSMTP


  1. Git clone(recommend)

    $git clone

  2. Download
    1. Dowload last source code zip/tar.gz package from
    2. Download last package uploading by developer from

Run in terminal

  1. pipe mode [1]

    $echo "contents from pipe." | python --host="" --from="" --to=";" --user="" --password="p4word" --subject="mail title"

  2. file mode

    $python --host="" --from="" --to=";" --user="" --password="p4word" --subject="mail title" --file="/path/to/file"

  3. option mode

    $python --host="" --from="" --to=";" --user="" --password="p4word" --subject="mail title" --content="contents from option"

NOTE: The priority of three mode: pipe mode, file mode, option mode.


[1]pipe mode is very useful while working with nagios etc.
Something went wrong with that request. Please try again.