Strange Issue with sendmail

more works.sh

#!/bin/ksh

{
        print "From: reportgenerator@myserver.com"
        print "To: randomguy@myfirm.com"
        print "MIME-Version: 1.0"
        print "Content-Type: text/html"
        print "Subject: Disk Report"
        print "<body>"
        print "<table border=1>"
        print "<tr>"
        print "<th bgcolor=#D7D3D3>Disk</th>"
        print "<th bgcolor=#D7D3D3>Growth</th>"
        print "</tr>"
        print "</table>"
        print "<p>Today's by: 999,999</p>"
        print "</body>"
        print "</html>"
} | /usr/sbin/sendmail -t

I run works.sh and i see the table in my email body as expected.

but more fails.sh

#!/bin/ksh

{
        print "From: reportgenerator@myserver.com"
        print "To: randomguy@myfirm.com"
        print "MIME-Version: 1.0"
        print "Content-Type: text/html"
        print "Subject: Disk Report"
        print "<body>"
        print "<table border=1>"
        print "<tr>"
        print "<th bgcolor=#D3D3D3>Disk</th>"
        print "<th bgcolor=#D3D3D3>Growth Monthly</th>"
        print "</tr>"
        print "</table>"
        print "</body>"
        print "</html>"
} | /usr/sbin/sendmail -t

Does not work as expected. I get email but the HTML Table does not show up ONLY text shows.

The only difference i see if it works when this line is added to the script

print "<p>Today's report shows progress by: 999,999</p>" and fails when removed.

Can you please try to run both of the scripts and see it for yourself. Also, help explain and fix ?

And if both work for you .. still do let me know so we can debug accordingly.

I tested your script with three different recipients using GMail, Notes and Roundcube clients and in every situation the HTML table was displayed properly.

maybe including opening html tag:

#!/bin/ksh

{
        print "From: moderator@myserver.com"
        print "To: randomguy@myfirm.com"
        print "MIME-Version: 1.0"
        print "Content-Type: text/html"
        print "Subject: Disk Report"
        print ""
        print "<html>"
        print "<body>"
        print "<table border=1>"
        print "<tr>"
        print "<th bgcolor=#D3D3D3>Disk</th>"
        print "<th bgcolor=#D3D3D3>Growth Monthly</th>"
        print "</tr>"
        print "</table>"
        print "</body>"
        print "</html>"
} | /usr/sbin/sendmail -t

Try rdrtx1's suggestion, and use ' instead of the single quote.