Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 2.37 KB

README.rst

File metadata and controls

62 lines (44 loc) · 2.37 KB

README

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 SendmailViaSMTP.py to any machine which had python installed. SendmailViaSMTP is distributed under the BSD license.

  • 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.
  1. Git clone(recommend)
    $git clone https://github.com/leopku/SendmailViaSMTP.git
  2. Download
    1. Dowload last source code zip/tar.gz package from http://github.com/leopku/SendmailViaSMTP/archives/master
    2. Download last package uploading by developer from http://github.com/leopku/SendmailViaSMTP/downloads
  1. pipe mode [1]
    $echo "contents from pipe." | python SendmailViaSMTP.py --host="mail.domain.com" --from="myname@yourdomain.com" --to="friends1@domain1.com;friends2@domain.com" --user="myname@yourdomain.com" --password="p4word" --subject="mail title"
  2. file mode
    $python SendmailViaSMTP.py --host="mail.domain.com" --from="myname@yourdomain.com" --to="friends1@domain1.com;friends2@domain.com" --user="myname@yourdomain.com" --password="p4word" --subject="mail title" --file="/path/to/file"
  3. option mode
    $python SendmailViaSMTP.py --host="mail.domain.com" --from="myname@yourdomain.com" --to="friends1@domain1.com;friends2@domain.com" --user="myname@yourdomain.com" --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.