The following code works when I directly run it in bash shell:SUBJECT=SUBJECT-`date`;MAIL_FROM=abc@site.com;MAIL_TO=abc@site.com;MAIL_CC=abc@site.com;MAIL_FILE=/path/of/html/body.html;(echo -e Subject: $SUBJECT\nMIME-Version: 1.0\nFrom: $MAIL_FROM\nTo:$MAIL_TO\nCc:$MAIL_CC\nContent-Type: text/html\nContent-Disposition: inline\n\n;/bin/cat $MAIL_FILE) | /usr/sbin/sendmail -f  $MAIL_FROM $MAIL_TO;But when I try to run it within a script like below...Contents of mail.sh:#!/usr/bin/kshSUBJECT=SUBJECT-`date`;MAIL_FROM=abc@site.com;MAIL_TO=abc@site.com;MAIL_CC=abc@site.com;MAIL_FILE=/path/of/html/body.html;(echo -e Subject: $SUBJECT\nMIME-Version: 1.0\nFrom: $MAIL_FROM\nTo:$MAIL_TO\nCc:$MAIL_CC\nContent-Type: text/html\nContent-Disposition: inline\n\n;/bin/cat $MAIL_FILE) | /usr/sbin/sendmail -f  $MAIL_FROM $MAIL_TO;I get the following results...$ sh mail.sh  #Mail sent but the body is in text format containing -e Subject: SUBJECT-Wed Jan 30 04:45:42 EST..... and the HTML code rendered as text.$ bash mail.sh  # Mail is received with mail body containing correct HTML format.So it seems that echo -e is recognized by bash. But when I use #!/usr/bin/bash and run the script as $ sh mail.sh I still get a mail in text format.Why is this so..? Thanks in advance for your suggestions.
Why does sendmail work differently in different shells?
bash;shell;solaris;ksh;sendmail
The Solaris echo $ echo -e foo-e foodoes not work like most some other echo commands:$ bash$ echo -e foofoo $ which echo/usr/bin/echo$ type -t echobuiltinThe bash builtin version works as expected, the ksh builtin keeps the Solaris behaviour (echo behaviour is usually system dependent in ksh when options are used).A plain echo should work in ksh, no -e:$ ksh$ echo -e foo\nbar-e foobar$ echo foo\nbarfoobarSo you have a Solaris problem, rather than a sendmail problem :-)You could try printf as a more portable way of doing this.