Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7872055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:05:43+00:00 2026-06-03T02:05:43+00:00

I have created a windows test app in which i am connecting to my

  • 0

I have created a windows test app in which i am connecting to my hotmail account and checking the unread mails there.Currently through my app ,i m getting the last mail from my hotmail account.

How can i get the latest mail and whether is it possible to get the subject and body of the latest mail using SSLStream object.

I am posting my code here.Please help me with this one.Any proper help will be appreciated.The place where it is written that “to get the first mail”,i am only getting the total bytes of the first mail.Please help me to get the first email subject and body.

        TcpClient mail = new TcpClient();
        SslStream sslStream;
        int bytes = -1;
        mail.Connect("pop3.live.com", 995);
        sslStream = new SslStream(mail.GetStream());
        sslStream.AuthenticateAsClient("pop3.live.com");

        byte[] buffer = new byte[2048];
        // Read the stream to make sure we are connected
        bytes = sslStream.Read(buffer, 0, buffer.Length);
        string message = Encoding.ASCII.GetString(buffer, 0, bytes);
        MessageBox.Show(message);

        //Send the users login details
        sslStream.Write(Encoding.ASCII.GetBytes("USER user_name\r\n"));
        bytes = sslStream.Read(buffer, 0, buffer.Length);
        string message1 = Encoding.ASCII.GetString(buffer, 0, bytes);
        MessageBox.Show(message1);

        //Send the password                        
        sslStream.Write(Encoding.ASCII.GetBytes("PASS password\r\n"));
        bytes = sslStream.Read(buffer, 0, buffer.Length);
        string message2 = Encoding.ASCII.GetString(buffer, 0, bytes);
        MessageBox.Show(message2);

        // Get the first email 
        sslStream.Write(Encoding.ASCII.GetBytes("RETR 1\r\n"));
        bytes = sslStream.Read(buffer, 0, buffer.Length);
        string message4 = Encoding.ASCII.GetString(buffer, 0, bytes);
        MessageBox.Show(message4);

        string str = string.Empty;
        string strTemp = string.Empty;
        StreamReader reader = new StreamReader(sslStream); 
        while ((strTemp = reader.ReadLine()) != null)
        {

            // find the . character in line
            if (strTemp == ".")
            {
                break;

            }
            if (strTemp.IndexOf("-ERR") != -1)
            {
                break;

            }
            str += strTemp;

        }
        MessageBox.Show(str);
    }

With some modifications in the code i am able to access the hotmail account.But with the same code when i try to access the AOl account.I am getting IO exception.Can anyone help me to how to connect to AOL mail sysytem using this code.Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:05:44+00:00Added an answer on June 3, 2026 at 2:05 am

    I think you have to implement the pop protocol to get email for pop server; in your case hotmail. You will find good article about opening mails from pop3 servers like hotmail/gmail over here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a Windows CE6 Image through Platform Builder, and I now want
I have a form created in Windows Forms which is draggable wherever I click.
I have created a taskbar using tabcontrols which works similarly to the Windows taskbar.
Here is the cenario: I have an account created on Active Directory named Test
I have created a Windows Service in VB.net for building xML from a database.
hello i have created one windows application in c# .net and its working fine
I have created a C# Windows service but it fails to start. I get
I have created a simple windows service that periodically checks a remote database via
I have created a program with Windows Forms in C# and the architecture is
I have created two forms in my Windows Application. One Form acts as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.