You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling Send-MgUserMail from Microsoft.Graph.Users.Actions 2.26.0 with content-type "html" the sent email contains unicode-like codes instead of the given html-tags. The code was running nicely with 2.25.0.
Characters such as: '
in the subject line also get garbled to some codes.
Mail sample:
Expected behavior
Same code running but in 2.25.0, mail sample:
How to reproduce
snippet of code:
`
$contenttype = "html"
$saveInSend = "true"
# Read the mail template from file
$mailTemplate = Get-Content "./body.html" -Raw
$mailBody = $mailTemplate
foreach ($property in $appRegSinner.PSObject.Properties) {
$placeholder = "#{0}#" -f $property.Name
$mailBody = $mailBody.Replace($placeholder, $property.Value)
}
$subject = "Registrering af Azure Application '$($appRegSinner.appName)' i ServiceNow"
# Override the mail receiver address if specified
$override = $overrideMailReceiverAddress.TrimEnd()
if ($override -ne "none") {
$appRegSinner.to = $overrideMailReceiverAddress
}
$params = @{
Message = @{
Subject = $subject
Body = @{
ContentType = $contenttype
Content = $mailBody
}
ToRecipients = @(
@{
EmailAddress = @{
Address = $appRegSinner.to
}
}
)
CcRecipients = @(
@{
EmailAddress = @{
Address = $appRegSinner.cc
}
}
)
}
SaveToSentItems = $saveInSend
}
Write-Information "Sending mail to $($appRegSinner.to)"
$params | ConvertTo-Json -Depth 5 | Write-Information
Send-MgUserMail -UserId $appRegSinner.from -BodyParameter $params
`
snippet of body.html
`
Du har oprettet denne Enterprise Application i Azure:
Navn: #appName#
AppID: #appId#
Den manglede at blive registreret i ServiceNow CMDB'en. Me...
`
SDK Version
2.26.0
Latest version known to work for scenario above?
2.25.0
Known Workarounds
Force usage of 2.25.0 modules all around.
Debug output
Click to expand log
```
</details>
### Configuration
OS: Windows + Ubuntu
Powershell: 7.5.0
### Other information
_No response_
The text was updated successfully, but these errors were encountered:
Hi @pbo-top apologies for the inconvenience. The issue had already been reported here #3160 and resolved. Please wait for the next release. I'll therefore close this as a duplicate
Describe the bug
When calling Send-MgUserMail from Microsoft.Graph.Users.Actions 2.26.0 with content-type "html" the sent email contains unicode-like codes instead of the given html-tags. The code was running nicely with 2.25.0.
Characters such as: '
in the subject line also get garbled to some codes.
Mail sample:

Expected behavior
Same code running but in 2.25.0, mail sample:
How to reproduce
snippet of code:
`
$contenttype = "html"
$saveInSend = "true"
`
snippet of body.html
`
Du har oprettet denne Enterprise Application i Azure:
Navn: #appName#
AppID: #appId#
Den manglede at blive registreret i ServiceNow CMDB'en. Me... `
SDK Version
2.26.0
Latest version known to work for scenario above?
2.25.0
Known Workarounds
Force usage of 2.25.0 modules all around.
Debug output
Click to expand log
```The text was updated successfully, but these errors were encountered: