0
Answer

reading email

Ask a question
Felipe Marks

Felipe Marks

16y
4.5k
1
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