linux - Sending email with HTML body and attachement with mailx -


i'm using mailx send html formated mails scripts :

cat body.html | /usr/bin/mailx -a "from: me <me@domain>" -a "content-type: text/html" -s "my subject" $recipients 

now i'd add attachement (png image) cannot figure out how. i'd try mailx before moving mutt or else. lot

if requirements simple, can use bare sendmail. not particularly recommend, since wanted avoid mutt...

# concatenate 2 files (well, stdin , file), # no longer eligible useless use of cat award ( cat - body.html <<here subject: subject mime-version: 1.0 content-type: multipart/related; boundary="foooobar"  --foooobar content-type: text/html  here  cat <<here  --foooobar content-type: image/png content-disposition: inline content-transfer-encoding: base64  here  base64 image.png  echo; echo '--foooobar--' ) | sendmail -oi $recipients 

i wish there simple, standard utility this, alas, instead there many, more or less mutually incompatible , murky. again, if can use mutt, that's supported , standard tool can hope for.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -