Avatar of BrainyYack1
BrainyYack1

asked on 

Using interop to send meeting request works on dev machine, but not work on production server

   
   I use the following code to send meeting request. It works fine on my development machine. But it does not work on production server.
 
    SendMeetingRequest(string toEmail, string subject, string body, DateTime startDate, DateTime endDate)
    {    
        Application objOL = new Application();
        AppointmentItem objAppt = (AppointmentItem)objOL.CreateItem(OlItemType.olAppointmentItem);
        objAppt.Start = startDate;
        objAppt.End = endDate;
        objAppt.Subject = subject;
        objAppt.Body = body;
        objAppt.MeetingStatus = OlMeetingStatus.olMeeting;
        objAppt.RequiredAttendees = toEmail;
        objAppt.Send();
        objAppt = null;
        objOL = null;
    }

      The error is:
      " Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
      Exception Details: System.Runtime.InteropServices.COMException: Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))"

      And it shows that the error line is "objAppt.Send();"
     
       Both my development machine and production server have outlook 2007.


ASP.NETC#.NET Programming

Avatar of undefined
Last Comment
William Domenz
Avatar of William Domenz
William Domenz
Flag of United States of America image

Is this code running as a 'service' ?
What is the application code credentials?
Avatar of BrainyYack1
BrainyYack1

ASKER


The code is not running as a 'service'. It is in asp.net.

What does "What is the application code credentials?" mean?
I am refering to WHO is the code running as. In other words, office RUNS as the currently logged on user, so when you create the application object 'who' is it running as, the ASP.NET account or???
Avatar of BrainyYack1
BrainyYack1

ASKER


It is a web application, should be the ASP.NET account.
DOes the asp account have an exchange account?
Avatar of BrainyYack1
BrainyYack1

ASKER


 How can I let asp account have an exchange account?

 My programming works on my dev computer. And on my dev computer, I did not do anything like "let asp account have an exchange account".
I believe on your dev box the
Application objOL = new Application();
AppointmentItem objAppt = (AppointmentItem)objOL.CreateItem(OlItemType.olAppointmentItem);

is running under YOUR credentials...

You can 'Impersonate' another user... This has security implications so.... :) :(
http://msdn.microsoft.com/en-us/library/system.security.principal.windowsidentity.impersonate(VS.71).aspx

You may also be able to use CDO to create the appointment...
http://www.codeproject.com/KB/dotnet/Dot_Net_2005.aspx
http://69.10.233.10/KB/dotnet/Dot_Net_2005.aspx
http://support.microsoft.com/kb/310558
Avatar of BrainyYack1
BrainyYack1

ASKER



If using CDO, does the server have to install exchange server?   On our production server, there will be no exchange server. We use ISP's mail server.
Ahhhh...  Yeah, CDO is THE EXCHANGE server....

Try browsing this site as it has helped me a great deal with outlook proggramming...
ASKER CERTIFIED SOLUTION
Avatar of William Domenz
William Domenz
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo