Hello experts!!
I am trying to send an email with message body and attachment.but i am getting any one like message body or attachment.
I tried below command:
(echo "subject:test";echo "MIME-Version: 1.0";echo "content-transfer-encoding:base 64";echo "content-type:txt;name=test.txt";cat /path/test.txt) | \
/usr/lib/sendmail -r someone@ex.com -t someone@ex.com
when I tried this, I am getting attachment.
so for message body i tried the below command,
(echo "subject:test";echo "MIME-Version: 1.0";echo "content-transfer-encoding:base 64";echo "content-type:txt;name=test.txt";cat /path/test.txt;\
echo "'cat /path/test.txt'") | /usr/lib/sendmail -r someone@ex.com -t someone@ex.com
I got in attachment "cat /path/test.txt" this line. I read all unix forums and tried commands but didn't work.
please suggest me I want to send message body along with attachment using sendmail command.