GetTotalMessageCount Exception

Jun 9, 2010 at 7:37 AM


I get "Input string not in correct format" by calling GetTotalMessageCount in Pop3Client class.

Do I miss something? Is there an code sample for setting up the pop3 client ?


Thanks in advance

Jun 9, 2010 at 7:42 AM

The Exception Stack Trace is the following:

at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
at System.Int64.Parse(String s)\r\n
Higuchi.Net.Pop3.Command.Stat.GetTotalMessageCount(String text)
at Higuchi.Net.Pop3.Command.Stat.Result..ctor(String text)
at Higuchi.Net.Pop3.Pop3Client.ExecuteStat()
at Higuchi.Net.Pop3.Pop3Client.GetTotalMessageCount()

Jun 10, 2010 at 4:32 PM

OK.Please show me entire your code.
I'll check it.

Jun 10, 2010 at 8:03 PM

My initial code was:




Higuchi.Net.Pop3.Pop3Client popClient = new Higuchi.Net.Pop3.Pop3Client();
popClient.AuthenticateMode = Higuchi.Net.Pop3.Pop3AuthenticateMode.Pop;


popClient.Password ="xxxxxxx";
popClient.Port = 995;
popClient.ServerName ="";
popClient.Ssl = true;
popClient.UserName = "";
bool authpop = popClient.Authenticate();


if (authpop)




 long mc = popClient.GetTotalMessageCount();


 if (mc > 0)

long i = 1;
  while (i <= mc)
   Higuchi.Net.Pop3.Pop3Message msg = popClient.GetMessage(i);








As soon as I removed the line: 

popClient.Open() it worked....

Any ideas??


Thanks in advance


Jun 10, 2010 at 9:57 PM

Open method will open connection to pop3 server.
Inside Authenticate method,the connection already opened.
So,you need not call open method after calling Authenticate method.

Jul 19, 2012 at 3:55 PM
Edited Jul 19, 2012 at 3:56 PM

I get the same error. I did not used any Open or Close method. Can you please advice?

Also this does not appear all the time. It's occurance is random