1
Vote

Fails to parse messages...

description

Imports Opo.Net.Mail
 
    Dim pop As Pop3Client = New Pop3Client(host, port, user, pswd)
    pop.Connect()
    pop.Login()
 
    Dim converter As IMailMessageConverter = New MimeMailMessageConverter(New Opo.Net.Mime.RegexMimeParser())
 
    Return (From m As Pop3Client.MessageInfo In pop.Messages _
            Let msg = converter.ConvertFrom(pop.GetMessage(m.UniqueID)) _
            Select msg).ToList()
 
Yields...
 
System.ArgumentOutOfRangeException was unhandled
Message="startIndex cannot be larger than length of string. Parameter name: startIndex"
ParamName="startIndex"
Source="mscorlib"
StackTrace:
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at System.String.Substring(Int32 startIndex)
   at Opo.Net.Mail.MimeMailMessageConverter.ProcessEntities(IMailMessage& mailMessage, IMimeEntity mimeEntity)
   at Opo.Net.Mail.MimeMailMessageConverter.ConvertFrom(IMimeEntity mimeEntity)
   at Opo.Net.Mail.MimeMailMessageConverter.ConvertFrom(String mimeData)
   at Opo.Net.Mail.MimeMailMessageConverter.ConvertFrom(Object data)

comments

house_air wrote Apr 5, 2009 at 5:49 PM

I'm not sure in which cases the error occurs. I changed some lines in the code, where the problem could be located. Please test the new version and - if the error remains - include the MIME data you were using in a further comment. Thanks

wrote Apr 5, 2009 at 6:02 PM

wrote Feb 13, 2013 at 2:16 AM