nmarus / node-ews

A simple JSON wrapper for the Exchange Web Services (EWS) SOAP API.
MIT License
116 stars 52 forks source link

401 unauthorised access #83

Closed chaksoham closed 5 years ago

chaksoham commented 6 years ago

const ewsConfig = { username: 'acb.efg@ipsoft.com', password: 'abc1234', host: 'https://blrmail.company.com', auth: 'basic', strictSSL: false, // in case you can't trust the certs };

      const promise = new Promise((resolve, reject) => { 

        try {
            const ews = new EWS(ewsConfig);

            const ewsFunction = 'ExpandDL';

            // define ews api function args
            const ewsArgs = {
              'Mailbox': {
                'EmailAddress':'transportList@company.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);
              });
chaksoham commented 6 years ago

Hey, could you help me out I am not able to connect to my mail box. My main use case is to read mail and filter them on basis of the subject.

kcastrotech commented 6 years ago

Sounds like you have a permission or username/password issue. You'll also need to make sure that you can access the WSDL (e.g. "https://blrmail.company.com/EWS/Services.wsdl").

If you are 100% sure you have a good username and password and that the WSDL is accessible then you might try using something like EWSEditor (https://ewseditor.codeplex.com/) to do some testing/debugging.