shell - Include Images in HTML email send from Unix Box -
i have script sends html emails. trying include images html emails. possible ? file has utilize function. i'm not looking quick 1 liner instead of function because of file manipulations have done in script. when send out emails [x] instead of image.
email function of script.
#!/bin/bash email() { export mailto="adc@aol.com" export content="file" export subject="report" ( echo "subject: $subject" echo "to : $mailto" echo "mime-version: 1.0" echo "content-type: text/html" echo "content-disposition: inline" cat "$content" ) | /usr/sbin/sendmail $mailto } email
file sending "file"
<html> <body> <img src="/home/admin/afriendlycow.png"> </body> </html>
i effort seek file name instead of path such afriendlycow.png not work also.
you not attaching images. proper html email images multipart/related
containing 1 text/html
part , 1 or more image/*
parts. should have content-id:
header unique identifier value; html refers them using <img src="cid:identifier">
.
html shell email unix
No comments:
Post a Comment