I have a vb.net application which uses EWS to send mail. The user account has no mailbox, but has permissions to send on behalf of another mailbox. Normally this code runs fine because it has the full email address to send to, however it fails when I try to find the address by resolving the name :
When making a request as an account that does not have a mailbox, you must specify the mailbox primary SMTP address for any distinguished folder Ids.
The code is as follows :
PrivateFunction ResolveName(ByVal Name AsString)AsStringDim returnValue As NameResolutionCollection
returnValue = _MainService.ResolveName(Name)Dim resolution As NameResolutionForEach resolution In returnValue Return resolution.Mailbox.AddressNextCall _Owner.LogThreadMessage(frmMain.ObjectTypes.Error,"Error resolving address", Name)Return""EndFunction
I think somehow it is trying to use the user account to access an address book, rather than the mailbox.