Need help with OpenPop
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: Need help with OpenPop

  1. #1
    Join Date
    Sep 2011

    Question Need help with OpenPop


    I am using OpenPop to read through the emails on my Hotmail account. What I want my code to do is display the HTML link in my email and display it in a listBox but its not working. Can you help?:

    ///Start POP3 connection
     Pop3Client client = new Pop3Client();
    //Login to email
                client.Connect("", 995, true);
                client.Authenticate("USER", "PASS");
                label18.Text = client.GetMessageCount().ToString();
                int messageCount = client.GetMessageCount();
                for (int i = 1; i <= messageCount; i++)
                    // Download the header and check if the message is interesting
                    // enough to download if with body
                    MessageHeader header = client.GetMessageHeaders(i);
                    if ("Wordpress".Contains(header.Subject))
                        // The message is interesting - download it
                        OpenPop.Mime.Message message = client.GetMessage(i);
                        // Find the first part containing HTML
                        // null is returned if such part is not found
                        MessagePart html = message.FindFirstHtmlVersion();
                        if (html != null)
                            String htmlContained = html.GetBodyAsText();
                            // Do something with the html
                            // here showing it in a listbox

  2. #2
    Arjay's Avatar
    Arjay is online now Moderator / MS MVP Power Poster
    Join Date
    Aug 2004

    Re: Need help with OpenPop

    Have you tried stepping through the code in a debugger to see what's failing?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a survey!

HTML5 Development Center