Search code examples
c#emailimap

MailBee Imap.Connect throws an Arithmetic operation resulted in an overflow error


I have an old program that I have been asked to update. It was originally built using .NET framework 2. I have updated this to version 4.5.

The code uses MailBee to connect to an email account and the old version works. The updated version however throws an "Arithmetic operation resulted in an overflow" error when I call the Connect function of the Imap object.

MailBee.Global.SafeMode = true;
Imap imap = new Imap();
imap.Log.Enabled = true;
imap.Log.Filename = control.MailBeeLogDir + "MailBee_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".log";
imap.SslMode = MailBee.Security.SslStartupMode.OnConnect;
imap.Connect(control.EmailServer, control.EmailPort);

The log file has no errors and seems to connect successfully.

Any suggestions?


Solution

  • You're using a very old version of MailBee.NET Objects (v3). The up-to-date version is v12. Update to the latest version and try again.