Hi folks. I’m trying to setup sending emails via PowerShell and have the code to do it, but every time i use Send-MailMessage to send the body, it converts apostrophe symbol to question mark. Can someone advise what i’m doing wrong? I tried to convert it to UTF8 and ASCII but that made it worse. Thank you
$message = get-content c:\mail\sample.txt | out-string
Send-mailmessage -To fakeuser@contso.com -From testuser@contso.com -smtpserver “196.192.1.1” -subject “Test email” -Body $message
The sample.txt file in c:\temp has the correct message format like this below
“Please don’t send out wrong requests for support”
But once i execute the PS script, and get the email, it is written incorrectly as below
“Please don?t send out wrong requests for support”