View Single Post
  #1  
Old November 8th 07, 08:02 AM posted to microsoft.public.outlook.program_forms
Lovely Stone
external usenet poster
 
Posts: 1
Default How to use C# to read E-Mail ?

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)
Ads