Skip to content

Send-MgUserMail: Issue with special characters #2996

@shredstick

Description

@shredstick

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 = "[email protected]"
            }
        }
    )
}

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 = "[email protected]"
            }
        }
    )
}

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 ```
</details>


### 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_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions