-
Notifications
You must be signed in to change notification settings - Fork 231
Closed
Description
Bug Report
Prerequisites
- Can you reproduce the problem?
- Are you running the latest version?
- Are you reporting to the correct repository?
- Did you perform a cursory search?
Version
1.5.2
Description
When i am sending Mails via the sendMail-Route it always throws an error "invalid json response body at https://graph.microsoft.com/v1.0/users/MY_USER_ID/sendMail reason: Unexpected end of JSON input"
Code-Example
const mailMessage = {
message: {
subject: 'My Mail-Subject',
body: {
contentType: 'Text',
content: 'My Mail-Content only Text.'
},
from: {
emailAddress: {
address: 'from@domain.com'
}
},
toRecipients: [
{
emailAddress: {
address: 'to@domain.com'
}
}
]
},
saveToSentItems: false
}
try {
await client.api(`/users/${userId}/sendMail`).post(mailMessage)
} catch (e) {
console.error(JSON.stringify(e, undefined, 4))
}
Console Errors:
{
"statusCode": 202,
"code": "FetchError",
"message": "invalid json response body at https://graph.microsoft.com/v1.0/users/MY_USER_ID/sendMail reason: Unexpected end of JSON input",
"requestId": null,
"date": "2019-03-27T15:12:20.964Z",
"body": "FetchError: invalid json response body at https://graph.microsoft.com/v1.0/users/MY_USER_ID/sendMail reason: Unexpected end of JSON input"
}
Steps to Reproduce
- Sending POST-Request via client to sendMail-Route
- When the response come back, it falls into the catch-block with statusCode 202 and the message from above
Expected behavior:
Finish without throwing an error.
Actual behavior:
Throwing an error, but mails was sent.
vgrem and jlippold
Metadata
Metadata
Assignees
Labels
No labels