none
Sending Meeting Invite as delegate in .net code RRS feed

  • Question

  • A user user1 has given delegate access to his calendar and inbox to another user appuser.

    I want to create a calendar item on user1's calendar and send meeting invite to the attendees on his behalf using the login credentials of appuser.

    I am able to create the event on user1's calendar and i am able to access that meeting invite uri directly in IE using appuser's credentials

    https://exchangeservername/exchange/user1/calendar/<uniqueid>MeetingInvite.eml - using appuser's credentials.

    Now to send the mail i am trying to use MOVE method. The code is as shown below.

    HttpWebRequest moveRequest = (HttpWebRequest)HttpWebRequest.Create("https://exchangeservername/exchange/user1/calendar/<uniqueid>MeetingInvite.eml");

     moveRequest.Credentials = credentials;
     moveRequest.Method = "MOVE";
     moveRequest.Headers.Add("Destination", "https://exchangeservername/exchange/user1
    /##DavMailSubmissionURI##/");

     // Put the message in the mail submission folder.
     HttpWebResponse moveResponse = (HttpWebResponse)moveRequest.GetResponse();
     moveResponse.Close();

    I am getting 401:Unauthorized error. The credentials used in the above code are appuser's credentials.

    If user1 adds appuser as delegate, doesnt user1 has permission to send mail?

    OR am i doing wrong in moving to user1's submissionuri?

    I also tried destination as ""https://exchangeservername/exchange/appuser/##DavMailSubmissionURI##/"

    But it is giving bad gateway error.

     

    I need to implement send on behalf functionality. Can anyone please help me in understanding which folders on the exchange server will the delegate have access on and what should be the destimation for the move request..

     

    Thanks in advance..

    Wednesday, May 11, 2011 8:28 PM