none
EWS error when trying to use .ResolveName RRS feed

  • Question

  • 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 :

    Private Function ResolveName(ByVal Name As String) As String
            Dim returnValue As NameResolutionCollection
            returnValue = _MainService.ResolveName(Name)
    
            Dim resolution As NameResolution
    
            For Each resolution In returnValue            
                Return resolution.Mailbox.Address
            Next
            Call _Owner.LogThreadMessage(frmMain.ObjectTypes.Error, "Error resolving address", Name)
    
            Return ""
    
        End Function

    I think somehow it is trying to use the user account to access an address book, rather than the mailbox.

    Thursday, January 16, 2014 5:24 PM