Node.js Use outlook mailbox to send mail

Developer GZ 40 Reputation points
2024-12-06T06:53:47.34+00:00

Our Node.js program used to use Outlook email to send emails without any issues, and provided user/password authentication using Basic. However, the Basic authentication method has recently been abandoned by Outlook mailbox, so now email sending has failed. I checked the information and it says that oauth2 authentication needs to be enabled, May I ask how to fix this issue and what tasks do I need to do? Using Outlook can successfully send emails.

Microsoft 365 and Office | Development | Other
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Developer GZ 40 Reputation points
    2024-12-06T08:17:33.1033333+00:00

    sender = "******@outlook.com"

    I use API https://graph.microsoft.com/v1.0/users/{sender}/sendMail to send Mail

    get response :

    {"error":{"code":"MailboxNotEnabledForRESTAPI","message":"The mailbox is either inactive, soft-deleted, or is hosted on-premise."}}

    What's wrong? I

    0 comments No comments

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.