I am trying to import mails from Outlook to my Database during execution of code it is throwing the "Excepiton ComException unhandeled by User Code".
it was working fine in the beggening but suddenly start throwing this exception.
Here is my code
for (int i = 0; i <= myInbox.Items.Count; i++)
{
lblSubject = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).Subject.ToString(); //throws exception here
txtBody = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).Body;
// if (((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).CC.Length > 0)
Mail_CC = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).CC;
}
please help me.