Description
Hi,
I have used this package for a while and everything has been working perfectly.
Until now.
With exactly the same setup I nowadays get the response:
Error SoapFaultDetails {
message: '401 Unauthorized',
InnerException: null,
faultCode: null,
faultString: null,
faultActor: null,
responseCode: 127,
errorCode: 0,
exceptionType: null,
lineNumber: 0,
positionWithinLine: 0,
errorDetails: DictionaryWithStringKey {
keys: [],
keysToObjs: {},
objects: {},
keyPicker: [Function (anonymous)]
},
HttpStatusCode: 401,
Exception: ServiceRequestUnauthorizedException {
message: '401 Unauthorized',
InnerException: null
}
}
Here is my setup:
const EXCHANGE_URL = 'https://outlook.office365.com/EWS/Exchange.asmx';
const ewsLogin = config.exchange.login;
const ewsPassword = config.exchange.password;
const service = new ews.ExchangeService(ews.ExchangeVersion.Exchange2013);
service.Credentials = new ews.WebCredentials(ewsLogin, ewsPassword);
service.TraceEnabled = true;
service.TraceFlags = ews.TraceFlags.All;
const email = new ews.EmailMessage(service);
email.ToRecipients.Add('[email protected]');
email.Subject = 'xxx';
email.Body = new ews.MessageBody('xxxx');
email.Body.BodyType = ews.BodyType.Text;
email.Send()
.then((val) => {
console.log("Sent");
})
.catch((e) => {
console.log("Error ", e);
});
Please help me :P