You are actually very close, under your message.addMimePart line and before you send..., add the following:
var reportFile = new MimeAttachment("report.html"); reportFile.content = content; // assign the value of the content variable to the MimeAttachment content -- assuming formatted as HTML reportFile.mimeType = "text/html"; // Set the mimeType for the file // now add this mimeAttachment to the e-mail message: message.addMimePart(reportFile, reportFile.mimeType);
Ta-Da!