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.
What is the application code credentials?