How to use C# to read E-Mail ?

L

Lovely Stone

I want to use class of TcpClient in C# to read email, the codes is as follows:
TcpClient client = new TcpClient(strHostName, nPort);
NetworkStream ns = client.GetStream();
StreamWriter sw = new StreamWriter(ns);
sw.WriteLine("USER myAccountName");
The last line of code execution prompt me : "-ERR Command is not valid in
this state." ==> what should I do before sw.WriteLine("USER myAccountName"); ?
(The pop3 server is exchange2007)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top