Good morning,
I'm encountering an exception while trying to load the stream of certain EML files using the Rebex library. This issue only occurs with a limited number of files. Below is the code I'm using for loading the stream:
public static void TestRebex(string folderPath) {
List<MailMessage> emails = new List<MailMessage>();
string[] emlFiles = Directory.GetFiles(folderPath, "*.eml");
foreach (string filePath in emlFiles)
{
using (FileStream fs = new FileStream(filePath, FileMode.Open))
{
MailMessage email = new MailMessage();
email.Load(fs);
emails.Add(email);
}
}
}
Exception StackTrace:
at kdtpl.zuplm.rnrto(String p0)
at Rebex.Mime.Headers.MimeParameterList.zkrdk(ctygm p0)
at Rebex.Mime.Headers.ContentType.bpezc(ctygm p0)
at Rebex.Mime.MimeHeader.fdqhx(String p0, String p1)
at Rebex.Mime.MimeHeader.get_Value()
at Rebex.Mime.MimeEntity.jqwiv(Encoding p0, Encoding p1)
at kdtpl.kmpif.tzdze(Byte[] p0, Int32 p1, Int32 p2)
at kdtpl.kmpif.uaeta(Byte[] p0, Int32 p1, Int32 p2, Boolean p3)
at kdtpl.khhpg.nmpsc(Boolean p0)
at kdtpl.khhpg.Write(Byte[] buffer, Int32 index, Int32 count)
at Rebex.Mime.MimeEntity.qbeow(Stream p0, Boolean p1)
at Rebex.Mail.MailMessage.Load(Stream input)
at xxxxxxxxxxxx.TestRebex() in xxxxxxxxxxxxxri.cs:line 1595
I'd like to emphasize that, unfortunately, I can't share the EML files causing the exception with you. However, I was wondering if you could provide some suggestions on what I could check or which direction I could take to resolve this issue.
Thank you for your support.
Best regards,
Francesco