我正在尝试使用以下代码在另一个人的 Microsoft Outlook (2003) 日历中创建约会。运行此程序时,约会被保存在我的日历中。但没有发送给收件人。
try
{
Microsoft.Office.Interop.Outlook.Application app = null;
Microsoft.Office.Interop.Outlook.AppointmentItem appt = null;
app = new Microsoft.Office.Interop.Outlook.Application();
appt = (Microsoft.Office.Interop.Outlook.AppointmentItem)app
.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);
appt.Subject = "Meeting ";
appt.Body = "Test Appointment body";
appt.Location = "TBD";
appt.Start = Convert.ToDateTime("12/23/2009 05:00:00 PM");
appt.Recipients.Add("smuthumari@mycompany.com");
appt.End = Convert.ToDateTime("12/23/2009 6:00:00 PM");
appt.ReminderSet = true;
appt.ReminderMinutesBeforeStart = 15;
appt.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh;
appt.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy;
appt.Save();
appt.Send();
}
catch (COMException ex)
{
Response.Write(ex.ToString());
}
我错过了什么吗?谁能帮我解决这个问题?