How to connect Node service with Office 365 Mail Box

Shanker Bhandari 1 Reputation point
2020-06-02T15:17:17.863+00:00

I'm facing issues while trying to read mail from Office 365 account.
Below is the code I'm using:

const EWS = require('node-ews');

// exchange server connection info
const ewsConfig = {
username: 'myuser@myDomain.com',
password: 'mypassword',
host: 'https://outlook.office365.com/owa/myDomain.com/',
auth: 'basic'
};

// initialize node-ews
const ews = new EWS(ewsConfig);

// define ews api function
const ewsFunction = 'ExpandDL';

// define ews api function args
const ewsArgs = {
'Mailbox': {
'EmailAddress':'publiclist@keyman .com'
}
};

// query EWS and print resulting JSON to console
ews.run(ewsFunction, ewsArgs)
.then(result => {
console.log(JSON.stringify(result));
})
.catch(err => {
console.log(err.message);
});

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,929 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 18,366 Reputation points
    2020-06-03T06:22:32.467+00:00

    @Shanker Bhandari Thanks for using Microsoft Q&A forum. We currently supports the products listed in right-hand pane (more to be added soon)

    Since you have asked your issue in correct forums:  https://stackoverflow.com/questions/62155764/issue-while-connecting-node-service-with-office365-mail-exchange-server

    I suggest you to be patient and wait for an expert to answer in the StackOverflow forum.

    0 comments No comments