I am creating HTML format for sending email in Java and using below UNIX script to send it:
( echo "Subject: Test";
echo "To: test@mail.com";
echo "MIME-Version: 1.0";
echo "Content-Type: text/html";
echo "Content-Disposition: inline";
echo "";
cat HTML_Body
) | sendmail test@mail.com
But HTML_Body is getting distorted when I am receiving mails from this UNIX
command, also some special characters like !
are also getting added along with the body, also the alignment of some cells are getting distorted.
When I am copying the HTML_Body from Java console, the body is created properly, but after sendmail
command it is getting distorted.
I am using outlook
, and Unix version is : AIX serverName 1 6
Also please suggest some other options for sending mail through UNIX or using Java. I tried creating file from Java and sending it as an attachment but, in that file also, content was getting distorted.
[Edit] Adding more details, this bug is exact the same explained here for sendmail command.