# HG changeset patch # User HIROSE Yuuji # Date 1438594683 -32400 # Node ID 70de8824f27e6a98a09b7a7758067467fdd17b39 # Parent 7f9569a7e0ce863671c3de702a169b226fbb4736 sendmultipart.sh added to this repo. diff -r 7f9569a7e0ce -r 70de8824f27e sendmultipart.sh --- a/sendmultipart.sh Mon Aug 03 18:00:35 2015 +0900 +++ b/sendmultipart.sh Mon Aug 03 18:38:03 2015 +0900 @@ -1,9 +1,9 @@ #!/bin/sh # send multipart message via email -# (C)2012 by HIROSE Yuuji [yuuji(at)yatex.org] +# (C)2012,2015 by HIROSE Yuuji [yuuji(at)yatex.org] # You can obtain the latest version of this script from: # http://www.gentei.org/~yuuji/software/sendmultipart.sh -# Last modified Sat Aug 1 16:00:31 2015 on firestorm +# Last modified Mon Aug 3 18:37:19 2015 on firestorm # # Typical usage: # echo "Hi, here's photo I've taken. Enjoy" | \ @@ -79,11 +79,6 @@ $cat $1 } - -# if [ "$1" = "" ]; then -# usage -# fi - # Begin procedure if [ x"$rcpts" = x"" ]; then sendmail="cat" @@ -114,12 +109,7 @@ cattextwithheader $file ;; *) - case `echo $file | tolower` in - *.jpg|*.jpeg) echo "Content-Type: Image/jpeg" ;; - *.png) echo "Content-Type: Image/png" ;; - *.gif) echo "Content-Type: Image/gif" ;; - *) echo "Content-Type: Application/Octet-Stream" ;; - esac + file --mime-type $file | cut -d' ' -f2 echo "Content-Transfer-Encoding: base64" echo "Content-Disposition: inline; filename=\"$file\"" echo