Microsoft.Office.Interop.Outlook .Application oApp; Microsoft.Office.Interop.Outlook._NameSpace oNS; Microsoft.Office.Interop.Outlook.MAPIFolder oFolder; Microsoft.Office.Interop.Outlook._Explorer oExp; oApp=new Microsoft.Office.Interop.Outlook.Application(); oNS = (Microsoft.Office.Interop.Outlook._NameSpace)oApp.GetNamespace("MAPI"); oFolder=oNS.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders. olFolderInbox); oExp = oFolder.GetExplorer(false); oNS.Logon(Missing.Value, Missing.Value, false, true); Microsoft.Office.Interop.Outlook.Items items = oFolder.Items; //checking for unread mails foreach (Microsoft.Office.Interop.Outlook .MailItem mail in items) { if (mail.UnRead == true) { //Paste the code for already opened mails if (mail.SenderName.Trim() == "crozzX") { //Past...
C#, ASP.NET, SQL SERVER, CSS, HTML, examples and tutorials