how to read email from gmail using c#
<p>I want to create window application through which i can read email from gmail.</p>

<p>Actually i want to read proper format of email like to,from,subject,cc and body. </p>

<pre><code>        using (Imap imap = new Imap())
        {
            imap.ConnectSSL("mail.company.com");
            imap.Login("angel_y@company.com", "xyx***");

            imap.SelectInbox();
            List&lt;long&gt; uids = imap.SearchFlag(Flag.Unseen);
            foreach (long uid in uids)
            {
                string eml = imap.GetMessageByUID(uid);
                IMail message = new MailBuilder()
                    .CreateFromEml(eml);

                Console.WriteLine(message.Subject);
                Console.WriteLine(message.TextDataString);
            }
            imap.Close(true);
        }    
</code></pre>

<p>It is this error.
No connection could be made because the target machine actively refused it </p>
