1

I have a script in which I have the following line:

$body += "The file " + $item.Name + " is reaching $MaxSize GB! <br> Current Size: <b>" + $SizeInGb.ToString(".00") + " GB </b> <br />"+ "Path to file: " + $Path + "<br /> <br />" 

The problem is that my HTML doesn't get rendered/parsed (in Outlook)

My mail still shows as:

The file SRV20150818.VHD.ebxwyq is reaching 2 GB! <br> Current Size: <b>36,64 GB </b> <br />Path to file: \\srv641\Software G\update\ex\SRV565456.VHD.wyq<br /> <br />

Why is this?

The command I use to send my mail is:

Send-MailMessage -To "[email protected]" -From "[email protected]" -Subject $subject -Body $body -SmtpServer 192.168.16.18

1 Answer 1

5

You need to include -BodyAsHtml in Send-MailMessage

Send-MailMessage -To "[email protected]" -From "[email protected]" -Subject $subject -Body $body -BodyAsHtml -SmtpServer 192.168.16.18
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.