added the HTML generation code to make sending reports in HTML easier and in a standard look