0

So I am reading an email in PowerShell using Get-IMAP but the encoding is different from when then email is sent to when I read it in Powershell.

The email is sent like

Job Title: Administración#

but when I go to read the string of the body back it looks like this,

Job Title: Administraci=F3n#

$body = Get-IMAP -Credential $PeopleHubOffice365ConnectorAccountCredential -server "outlook.office365.com" -port "993" -ssl "implicit" -view $message.id -Timeout 60

I want to know how I can keep the same encoding as the email was sent so in all cases of special characters I don't get this problem. Thanks

lit
  • 14,456
  • 10
  • 65
  • 119
  • 2
    You have to show us your code, we don't have a crystal ball where we can look – tukan Aug 01 '18 at 09:32
  • $body = Get-IMAP -Credential $PeopleHubOffice365ConnectorAccountCredential -server "outlook.office365.com" -port "993" -ssl "implicit" -view $message.id -Timeout 60. Which returns the body of the email as body.text but the string in body.text has the line encoded as Administraci=F3n# – Sam Pink Aug 01 '18 at 10:07
  • 1
    Please edit your post and add that code there. Thanks – tukan Aug 01 '18 at 10:08
  • It's a MIME content transfer encoding called [QuotedPrintable](https://en.wikipedia.org/wiki/Quoted-printable), see also `[System.Enum]::GetNames([System.Net.Mime.TransferEncoding])`. – JosefZ Oct 13 '20 at 20:27

0 Answers0