Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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."}'
}
An API that connects multiple Microsoft services, enabling data access and automation across platforms