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

  • Home
  • SEARCH
  • 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 1095685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:09:51+00:00 2026-05-17T00:09:51+00:00

Hy, I have an application that sends mails with Gmail SMTP server (smtp.gmail.com) using

  • 0

Hy,

I have an application that sends mails with Gmail SMTP server (smtp.gmail.com) using SSL.

Now I want to read the emails from that account, does anyone have any idea how can I make this programatically in C# and ASP.NET?

At this point I’m using this code:

TcpClient tcpClient = new TcpClient();
tcpClient.Connect("pop.gmail.com", 587);

NetworkStream netStream = tcpClient.GetStream();
System.IO.StreamReader strReader = new System.IO.StreamReader(netStream);

Label7.Text = strReader.ReadLine() + "<br />"; 
//Label7.Text = "Server connected!";

byte[] WriteBuffer = new byte[1024];
ASCIIEncoding enc = new System.Text.ASCIIEncoding();

WriteBuffer = enc.GetBytes("USER " + TextBox4.Text + "\r\n");
netStream.Write(WriteBuffer, 0, WriteBuffer.Length);
Label7.Text += strReader.ReadLine() + "<br />";

WriteBuffer = enc.GetBytes("PASS " + TextBox5.Text + "\r\n");
netStream.Write(WriteBuffer, 0, WriteBuffer.Length);
Label7.Text += strReader.ReadLine() + "<br />";

WriteBuffer = enc.GetBytes("LIST\r\n");
netStream.Write(WriteBuffer, 0, WriteBuffer.Length);

String ListMessage;
while (true)
{
    ListMessage = strReader.ReadLine();
    if (ListMessage == ".")
    {
        break;
    }
    else
    {
        Label7.Text += ListMessage + "<br />";
        continue;
    }
}

WriteBuffer = enc.GetBytes("QUIT\r\n");
netStream.Write(WriteBuffer, 0, WriteBuffer.Length);
Label7.Text += strReader.ReadLine() + "<br />"; 

And when I debug it it’s shows that it’s connected but no response in retrieving emails.

  • 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-05-17T00:09:52+00:00Added an answer on May 17, 2026 at 12:09 am

    POP3 features of this open source project (I’m involved in) contains everything you need. Including secure communications support & advanced authentication.

    If you really want to do one yourself, browsing the source code will probably save you days of development.

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

Sidebar

Related Questions

I have a Play Framework application that sends emails using SMTP server. Now I
I have a PHP application that sends email using the pear Mail function. Unfortunately
I have a coldfusion application running right now with a login that sends a
I have a small WinForms application that sends notification emails. It works fine with
I have an application that sends automatic mails via a worker role. When I
I have an application that reads emails from ONE email account (gmail application account)
I have a link on a webpage that sends emails out from localhost SMTP
We have a web application that periodically sends out e-mails to users. At the
in my application i am able to send email using smtp server,for that i
I have developed one application which used to send/receive mails using Exchange Server 2003

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.