pmengal / MailSystem.NET

Great email library for C#.
GNU Lesser General Public License v3.0
270 stars 136 forks source link

[Error] System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. #38

Open jasonchen100 opened 6 years ago

jasonchen100 commented 6 years ago

Hi,

I have this issue couple times. I have two window services running in different machines and connect to different email accounts (MS Exchange server 2013). Structure are as follows:


email account A : (1) receive emails and redirect a copy to email account B (2) A window service will read emails and do what I code.

email account B: a service will read emails which redirect from email account A

*Both services runs same code, the difference are just point to different email account. (account A and account B)

But I received error as follows at account A's window service

Error: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. Parameter name: length at System.String.Substring(Int32 startIndex, Int32 length) at ActiveUp.Net.Mail.Fetch.ExtractMessageFromReponse(String response) at ActiveUp.Net.Mail.Fetch.MessageString(Int32 messageOrdinal) at ActiveUp.Net.Mail.Fetch.MessageObject(Int32 messageOrdinal)

I debug and find out that "ActiveUp.Net.Mail.Fetch.MessageObject" will fail but ActiveUp.Net.Mail.Fetch.HeaderObject(UnSeenMessage) can pass. I have run at least several months for over thousands of emails, only those certain email will fail ,but it works fine to those redirect emails.

Please advise.