Felipe Marks

Felipe Marks

  • NA
  • 76
  • 0

reading email

Dec 13 2007 2:25 AM
Hi there
im writing a program that has to read email from outlook. does anyone know how?
I managed to read all the subjects in my inbox but i'd like to read the 1st 1 in the inbox. here's the code i used to read the subjects..

Outlook.Application app = new Outlook.ApplicationClass();
Outlook.NameSpace NS = app.GetNamespace("MAPI");
Outlook.MAPIFolder inboxFld = NS.GetDefaultFolder(Outlook.OlDefaultFolders.olFol derInbox);

foreach(Outlook.MailItem t in inboxFld.Items)
{
Console.WriteLine(t.Subject);
}
thanks,
Eustace