Open sjbruni opened 2 years ago
I had the same issue. And I founded that the broken special characters in UTF-8 is generated by the missuse of the toString() for serializing the message with the C# class MimeKit.MimeMessage. Here the author of the lib explain why you shouldn't use this: https://github.com/jstedfast/MimeKit/issues/554
MimeKit.MimeMessage is called from Send-GmailMessage on line: $raw = New-MimeMessage @messageParams | Convert-Base64 -From NormalString -To WebSafeBase64String
I'm trying to send a message using the function "send-gmailmessage" with attribute "-bodyashtml", and of course using HTML format in the body. The issue is that when the message is received, the special characters like "ñ" and "ó" (the message is in Spanish), are not shown correctly.
For example show like "ñ" instead of "ñ" or "ó" instead of "ó"
I tried with the meta into the HTML:
But not working (of course tried also with "UTF-8" instead of "ISO-8859-1")
The powershell command line I'm using is:
Send-GmailMessage -From xxxx@yyy.edu.ar -Subject "Test email sending" -Body $htmlContent -BodyAsHtml -To "xxxx.yyyy@gmail.com" -Attachments "[Path of the file to been attached]"