none
Connect Node service with Office 365 Mail Box RRS feed

  • Pergunta

  • 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@domain.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);
      });
    terça-feira, 2 de junho de 2020 15:12

Respostas