Unable to log into outlook using domain/username and password

By | July 12, 2018

I’m trying to log into Outlook using a credential in the following format:

login id : domain/username
password : xxx

When I try the following code using the exchange service API, I get a connection timeout exception.

Service service = new Service("https://myserver/ews/Exchange.asmx", "user", "password");

Message message = new Message();
message.setBody(new Body("Body text"));
message.getToRecipients().add(new Mailbox("John@mydomain.com"));
message.getCcRecipients().add(new Mailbox("Mark@mydomain.com"));

ItemInfoResponse response = service.send(message);

Leave a Reply

Your email address will not be published. Required fields are marked *