Send-MailKitMessage icon indicating copy to clipboard operation
Send-MailKitMessage copied to clipboard

HtmlDecode of the HtmlBody

Open coffeeaddict1978 opened this issue 1 year ago • 0 comments

Hello,

Is it possible to make the decoding of HTML in HTMLBody optional?

Body.HtmlBody = HttpUtility.HtmlDecode(HTMLBody);    //decode html in case it was encoded along the way

I am attempting to have text in the html that contains < and >. I have already encoded it with [System.Web.HttpUtility]::HtmlEncode($foo) in PowerShell, which makes it safe to include in the broader properly-formatted HTMLBody message. The issue is the above call to HttpUtility.HtmlDecode(HTMLBody) will undo it.

coffeeaddict1978 avatar May 12 '24 00:05 coffeeaddict1978