Got 500 Internal Server Error From Graph API

Huma Khan 30 Reputation points
2026-01-21T04:56:24.0833333+00:00

Hi Team,

When I try to send outbound email from mailbox, I got 500 internal server error? Why Graph API has thrown this error:

Could you help me to know was there was any error on Graph API side?

Usng this API to send email

result = await client.api(`/users/${originEmail}/messages`).post(sendMail.message);
2026-01-13T05:28:05.451Z	c76b30fd-9e70-4025-81be-665c319b55eb	INFO	Inside sendEmail:  {
  actionType: 'newemail',
  payload: {
    actionType: 'newemail',
    emailAddress: [ '******@xxxx.xx' ],
    cc: [ '' ],
    bcc: [ '' ],
    emailContent: '',
    agent: '******@xxxxx.xx',
    attachments: [ [Object] ],
    subject: 'Test mail',
    emailDraft: false,
    agent_id: 'xxxxxx',
    agent_name: 'Huma Khan',
    emailResolved: false,
    emailStatus: 'Sent',
    assessmentstatus: 'Evaluation Pending',
    originEmail: '******@xx.xx',
    function: 'Hearing Aids',
    region: 'Europe',
    itemAttachment: true,
    itemAttachmentEmailBody: '7uak9fgbve.txt'
  }
}

2026-01-13T05:28:12.129Z	c76b30fd-9e70-4025-81be-665c319b55eb	INFO	error occured GraphError: An internal server error occurred. The operation failed.
    at new GraphError (/opt/nodejs/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphError.js:34:28)
    at Function.GraphErrorHandler.constructErrorFromResponse (/opt/nodejs/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:62:22)
    at Function.<anonymous> (/opt/nodejs/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:89:48)
    at step (/opt/nodejs/node_modules/tslib/tslib.js:143:27)
    at Object.next (/opt/nodejs/node_modules/tslib/tslib.js:124:57)
    at /opt/nodejs/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at __awaiter (/opt/nodejs/node_modules/tslib/tslib.js:113:16)
    at Function.GraphErrorHandler.getError (/opt/nodejs/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphErrorHandler.js:85:38)
    at GraphRequest.<anonymous> (/opt/nodejs/node_modules/@microsoft/microsoft-graph-client/lib/src/GraphRequest.js:315:84) {
  statusCode: 500,
  code: 'ErrorInternalServerError',
  requestId: null,
  date: 2026-01-13T05:28:12.128Z,
  body: '{"code":"ErrorInternalServerError","message":"An internal server error occurred. The operation failed."}'
}

Microsoft Security | Microsoft Graph
0 comments No comments

Your answer

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