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.

Outlook
Outlook
A family of Microsoft email and calendar products.
4,503 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,310 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,321 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,698 questions
{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.