0
votes

I am able to create a process mailbox and I am able to access thru https://ExchangeServer/owa/[email protected] then I will give my credentials and I am able to Login.

But I am not able to access thru EWS. It says SMTP address has no mailbox associated with it.

I am able to access my inbox with the same code..

1

1 Answers

0
votes

If you are able to connect to the mailbox through your exchange mail then you should be able to do the same in EWS. Create a service (ExchangeService) where you login with your exchange credentials and then use that service to connect to the mailbox

Mailbox mb = new Mailbox("[email protected]");
FolderId fid = new FolderId(WellKnownFolderName.Inbox, mb);
ItemView view = new ItemView(100);

//use your service to get 100 mails from the mailbox
var findResults = service.FindItems(fid, view);

foreach (var item in findResults.Items)
{
    var message = EmailMessage.Bind(service, item.Id, new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.Attachments));
}