I was trying to send an html file using mail commnad, but the mail contents alignment is not working.
Here is the command used to send the mail
/bin/mail -s "$(echo -e "log - $date\nFrom: ABC \n";)" abc@gmail.com < /root/test
After searching, I found that we need to add "Content-Type" on the header. So I have added it on the header and its worked, but the From header is not working and some additional info showing on the mail.
Here is the command I used to send mail :
/bin/mail -s "$(echo -e "log - $datet\nContent-Type: text/html\nFrom: ABC \n";)" abc@gmail.com < /root/test
The additional info showing on the mail while adding content-type is as follows : From: ABC User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable = =20
Could anyone please tell me how to send html using mail command with all the above options?