Computing.Net > Forums > Programming > read new email

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

read new email

Reply to Message Icon

Name: coolkang
Date: October 12, 2005 at 18:36:30 Pacific
OS: xp
CPU/Ram: p4/1gh
Comment:

Hi
Could somebody show me how to code a program to read a new email in MS outlook 2003. I code my project in C# to interface with MSoutlook 2003. Which right now i could get it to display the subject of the email. But my next problem is every thing i try to get the sender name or email address. I would pop-up a warning. Is there other way to do this. If you don't understand my question please let me know. Thank you.

here is my code so far

Outlook.Application oApp = new Outlook.ApplicationClass();
Outlook.NameSpace oNS = (Outlook.NameSpace)oApp.GetNamespace("mapi");
oNS.Logon(null, null, true, true);

Outlook.MAPIFolder oInbox = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);

foreach(object obj in oInbox.Items)
{
Outlook.MailItem item = obj as Outlook.MailItem;
if(item != null)
{
if(item.UnRead == true)
{
textBox1.Text = item.SenderName;
}
}
}



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


C++ String Project? Linker Error: Undefined S...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: read new email

Create reports from automated email www.computing.net/answers/programming/create-reports-from-automated-email/14663.html

read column info into a continous string www.computing.net/answers/programming/read-column-info-into-a-continous-string/19409.html

Speeding up a script i use www.computing.net/answers/programming/speeding-up-a-script-i-use/17133.html