Failed to send email: {"error":{"code":"BadRequest","message":"Request body validation error. Invalid Json payload.","target":null,"details":null,"innererror":null}}.

Ron Cohen 0 Reputation points
2024-06-18T13:17:00.5533333+00:00

I am trying to send an email with power shell and azure commnction,

when I send a post with that json-

$jsonString = @"
{
    "senderAddress": "DoNotReply@2a27eb63-5cbd-499a-8924-c9612d7ebb5f.azurecomm.net",
    "content": {
        "subject": "An exciting offer especially for you!",
        "plainText": "This exciting offer was created especially for you, our most loyal customer.",
         },
        "recipients": {
            "to": [
            {
                "address": "ron.cohen@sela.co.il",
                "displayName": "Ron Cohen"
            }
        ]
    }
}
"@

I am getting that-

Failed to send email: {"error":{"code":"BadRequest","message":"Request body validation error. Invalid Json payload.","target":null,"details":null,"innererror":null}}

Tnx!

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
899 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.