Forward Message using ExchangeWebServiceClient

I am trying to forward an email using the ExchangeWebServicesClient, however I cant seem to find the email address of the current mailbox.


Is it exposed anywhere?

Hi Chris,


First of all, please accept my sincere apologies for my delayed response.

Unfortunately, I am unable to find a way to get the email address of current Mailbox while using ExchangeWebServiceClient. I have logged an investigative ticket in this regard and sought help from the development team. The ticket Id for your reference is NETWORKNET-33366.

We will shortly reply you back with more updates.

Regards,

Hi,

Thank you for being patient towards the implementation of this feature by us.

We are pleased to inform you that we have supported this feature now. Please download this latest version of Aspose.Email for .Net v2.1.0 and use the following sample code for your requirements. It will return the email address of current Mailbox using ExchangeWebServiceClient.

ServicePointManager.ServerCertificateValidationCallback += CheckCertificate;

{
    ExchangeServiceBinding service = new ExchangeServiceBinding();

    {
        service.Credentials = new NetworkCredential("username", "password", "domain");
        service.Url = "server address";

        ResolveNamesType request = new ResolveNamesType();
        request.ReturnFullContactData = true;
        request.UnresolvedEntry = ((NetworkCredential)service.Credentials).UserName;
        request.SearchScope = ResolveNamesSearchScopeType.ActiveDirectoryContacts;

        ResolveNamesResponseType response = service.ResolveNames(request);
        ResolveNamesResponseMessageType responseMessageType = response.ResponseMessages.Items[0] as ResolveNamesResponseMessageType;
        string emailAddress = responseMessageType.ResolutionSet.Resolution[0].Mailbox.EmailAddress;

        Console.WriteLine(emailAddress);
    }
}

public static bool CheckCertificate(Object sender, X509Certificate certificate, X509Chainchain, SslPolicyErrors sslPolicyErrors)
{
    return true;
}

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan