Help emailing formatted HTML - Please

Having problems emailing an HTML report (script attached) I can run script and outputs a nice formatted table with conditioning as an HTML page, but either missing a trick sending as an email (works without the formatting) or I am using technique that is not really compatible.
I’m very much still learning so any help would be much appreciated.


In the html file you generate, you attach the head before outputting it to a file. When you email it you only send the body.

You’ve got to

$body = ConvertTo-Html -Head $Head -PostContent "$(get-date)" -Body $body | Out-String

send-mailmessage @Smtpsettings -Body $body -BodyAsHtml

Thanks Martin, will test it tomorrow, cheers!

Worked a treat, many thanks!