Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send email with Send-MgUserMail after updating to 2.26.0 #3163

Closed
rdvanto2 opened this issue Feb 21, 2025 · 1 comment
Closed

Cannot send email with Send-MgUserMail after updating to 2.26.0 #3163

rdvanto2 opened this issue Feb 21, 2025 · 1 comment
Labels
status:duplicate A duplicate issue type:bug A broken experience

Comments

@rdvanto2
Copy link

Describe the bug

Unable to send mail with version 2.26.0, after upgrading i get this error message:

Send-MgUserMail_Send: Invalid character after parsing property name. Expected ':' but got: ". Path
'Message.ccRecipients[0].emailAddress', line 8, position 28.

Expected behavior

I would like the mail to send without error. This works fine if version 2.25.0

How to reproduce

execute Send-MgUserMail with users in the CcRecipients. I am running powershell 7.5.0 on Redhat Linux

$params = @{
message = @{
subject = "Meet for lunch?"
body = @{
contentType = "Text"
content = "The new cafeteria is open."
}
toRecipients = @(
@{
emailAddress = @{
address = "[email protected]"
}
}
)
ccRecipients = @(
@{
emailAddress = @{
address = "[email protected]"
}
}
)
}
saveToSentItems = "false"
}

Send-MgUserMail -UserId $FromUser -BodyParameter $params -debug

SDK Version

2.26.0

Latest version known to work for scenario above?

2.25.0

Known Workarounds

none

Debug output

Click to expand log DEBUG: [CmdletBeginProcessing]: - Send-MgUserMail begin processing with parameterSet 'Send'. DEBUG: [Authentication]: - AuthType: 'UserProvidedAccessToken', TokenCredentialType: 'UserProvidedAccessToken', ContextScope: 'Process', AppName: 'xyz.Com'. DEBUG: [Authentication]: - Scopes: [Mail.Send].

DEBUG: [CmdletException]: Received exception with message 'JsonReaderException - Invalid character after parsing property name. Expected ':' but got: ". Path 'Message.ccRecipients[0].emailAddress', line 8, position 28. : at Newtonsoft.Json.JsonTextReader.ParseProperty()
at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
at Microsoft.Graph.PowerShell.UsersActions.UserSendMail(String userId, IDictionary headers, IComponentsVsh1S1RequestbodiesSendmailrequestbodyContentApplicationJsonSchema body, Func2 on2Xx, Func3 onDefault, IEventListener eventListener, ISendAsync sender)
at Microsoft.Graph.PowerShell.Cmdlets.SendMgUserMail_Send.ProcessRecordAsync()'
Send-MgUserMail_Send: Invalid character after parsing property name. Expected ':' but got: ". Path 'Message.ccRecipients[0].emailAddress', line 8, position 28.
DEBUG: [CmdletEndProcessing]: - Send-MgUserMail end processing.

Configuration

No response

Other information

No response

@rdvanto2 rdvanto2 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Feb 21, 2025
@timayabi2020
Copy link
Contributor

Hi @rdvanto2 apologies for the inconvenience. This issue has already been reported here #3159, kindly let us use that thread. I will mark this as a duplicate and close it.

@timayabi2020 timayabi2020 added status:duplicate A duplicate issue and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:duplicate A duplicate issue type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants