User265788195 posted
Note: Please move my post to appropriate forum
Looks like many of you have already gone through this. I am trying to send an email and meeting request using ASP.NET 2.0/C#.
Email gets sent without any problem to me and tried to send it to another friend also.
But The meeting request is never sent to my friend, but its added automatically to my calendar.
I did not get a email request. Please let me know what iam I missing here.
protected void Button1_Click(object sender, EventArgs e)
{
outlook._Application app = null;
outlook._NameSpace nameSpace = null;
outlook._MailItem memo = null;
outlook.MAPIFolder outbox = null;
app = new Microsoft.Office.Interop.Outlook.Application();
nameSpace = app.GetNamespace("MAPI");
nameSpace.Logon(null, null, false, true);
outbox = nameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderSentMail);
memo = (Microsoft.Office.Interop.Outlook._MailItem)app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
memo.To = "xxx@xxx.com";
memo.Subject = "TechRepublic.com Test";
memo.Body = "Hello there";
memo.SaveSentMessageFolder = outbox;
// Creates an Appointment in the outlook calender.
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 = "TechRepublic.com";
appt.Body = "Test";
appt.Location = "TBD";
appt.Start = Convert.ToDateTime("11/15/2006 01:00:00 PM");
appt.End = Convert.ToDateTime("11/15/2006 2:00:00 PM");
appt.RequiredAttendees = memo.To;
appt.ReminderSet = true;
appt.ReminderMinutesBeforeStart = 15;
appt.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh;
appt.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy;
appt.Save();
memo.Send();
}
Thanks,