connectseekers.com

Thursday, 20 August 2015

Read Outlook Inbox Mail And Email Count Of Inbox Using C#.Net

8/20/2015 - By Pranav Singh 0

This article will show you how you can read all the email present in your outlook and get the total count using c#.net.


Now have a look of the outlook email count.


So for this demo we will create a new windows application and add some button and label control in form. Now we will add the outlook library reference.


Now on button click add the below code.

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Outlook = Microsoft.Office.Interop.Outlook;
namespace WindowsFormsApplication5
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            List<string> objSubjectList = new List<string>();
            Outlook.Application objApplication = new Outlook.Application();
            Outlook.MAPIFolder objInboxEmail = objApplication.ActiveExplorer().Session.GetDefaultFolder(Outlook.OlDefaultFolders.
olFolderInbox);
            label2.Text = objInboxEmail.Items.Count.ToString();
        }
    }
}

In above code I have read all the email from outlook and display the count. Now we have done run the application to check the output. Have a look of the application in debug mode.


Now press F5 to check the final output.

DOWNLOAD 

About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com
Email Id : contact@aspdotnet-pools.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Top jQuery Plugins

Global Classified : Connectseekers.com
© 2014
back to top