microsoftgraph / msgraph-sdk-powershell

Powershell SDK for Microsoft Graph
https://www.powershellgallery.com/packages/Microsoft.Graph
Other
712 stars 172 forks source link

Send-MgUserMail: Issue with special characters #2996

Closed shredstick closed 2 weeks ago

shredstick commented 1 month ago

Describe the bug

Hello

Im trying to send an E-Mail using the following code:

$message = @{
    Subject      = 'TEST ÄÖÜ'
    Body         = @{
        ContentType = 'HTML'
        Content     = 'TEST ÄÖÜ'
    }
    ToRecipients = @(
        @{
            EmailAddress = @{
                Address = "test@test.com"
            }
        }
    )
}

Send-MgUserMail -UserId $SendEmailAccount -Message $message

Notice that im trying to send an email with special characters like Ä,Ö or Ü. The delivery of the email works fine but somewhere along the way the special characters (ÄÖÜ) get messed up. This is how the email looks like in the recipients mailbox:

image

I'm using the following versions: Microsoft.Graph.Users.Actions: 2.15.0 Microsoft.Graph.Authentication: 2.15.0

Every help is greatly appreciated.

Expected behavior

I expect the email to be delivered and the special characters to be handled accordingy and displayed properly.

How to reproduce

Send an email containing special characters using something like this:

$message = @{
    Subject      = 'TEST ÄÖÜ'
    Body         = @{
        ContentType = 'HTML'
        Content     = 'TEST ÄÖÜ'
    }
    ToRecipients = @(
        @{
            EmailAddress = @{
                Address = "test@test.com"
            }
        }
    )
}

Send-MgUserMail -UserId $SendEmailAccount -Message $message

SDK Version

2.15.0

Latest version known to work for scenario above?

No response

Known Workarounds

I have not found a workaround.

Debug output

Click to expand log ``` ```

Configuration

Windows Server 2016 Version 1607

Name Value


PSVersion 5.1.14393.7330 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14393.7330 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

Other information

No response

timayabi2020 commented 3 weeks ago

Hi @shredstick thank you for raising this issue. Are there any errors thrown by the cmdlet? Could you please share the debug output?

microsoft-github-policy-service[bot] commented 3 weeks ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.