CLI e-mail to Tbird
uriel1998 Sep 25th, 2011 525 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # To send via e-mail from Tux Commander (or Midnight Commander, or the command line)
- # using this format:
- # admin@box:$ thunderbird –compose “to=’email@example.com,firstname.lastname@example.org’,subject=’nice tip’,attachment=’file:///home/admin/tip.txt’,body=’Check out this neat command line tip’”
- # - so you could probably use zenity to input e-mail addresses and the like as well.
- # Tux Commander passes a full filename as $1; from the commandline it will cope with relative and absolute paths as well.
- # (Format ganked from http://www.kbrandt.com/2008/05/quick-tip-tunderbird-email-from-command.html)
- # if $1 is a file then it's an attachment
- # This is what the script is actually used for, but you could test for e-mail addresses and
- # the like this way.
- if [ -f "$1" ]; then
- # Testing for absolute vs. relative path
- # assuming that relative path starts from PWD.
- case $1 in
- filename=$(echo "file://$file")
- # currently goes right into mail loop - I want to populate subject, etc, in thunderbird.
- # if you want to do more, then populate each of the variables elsewhere.
- # mailing commandline
- thunderbird -compose "attachment=$filename"
RAW Paste Data