0 votes

Itried loading an eml but i get a Null Reference Exeption when i call MailBuilder().CreateFromEmlFile with the filepath.

System.NullReferenceException: Object reference not set to an instance
of an object. at Limilabs.Mail.MIME.MimeMultipart. (  ​  body)
at Limilabs.Mail.MIME.MimeMultipart.ParseBody(  ​  body) at
Limilabs.Mail.MIME.MimeFactory. (    message) at
Limilabs.Mail.MimeDocumentFactory. (Byte[] data) at
Limilabs.Mail.MimeDocumentFactory.CreateMimeDocument(Byte[] data)
at Limilabs.Mail.MailFactory.CreateMail(Byte[] data) at
Limilabs.Mail.MailBuilder.CreateFromEml(Byte[] eml) at
Limilabs.Mail.MailBuilder.CreateFromEmlFile(String path)

by (200 points)

1 Answer

0 votes

This looks like a mismatched .net version referenced.

Make sure you reference Mail.dll via nuget:
https://www.nuget.org/packages/Mail.dll/

-or-

When referencing directly make sure appropriate assemblies are also referenced:

System.Security.Cryptography.Algorithms (>= 4.3.1)
System.Security.Cryptography.Pkcs (>= 8.0.0)
System.Security.Cryptography.X509Certificates (>= 4.3.2)
System.Security.Cryptography.Xml (>= 8.0.0)
System.Text.Encoding.CodePages (>= 8.0.0)

for .net framework 2.0-4.8 no additional references are needed.


Can you please send us the eml file (preferably zipped)?

You can find our email address in this page footer.

by (301k points)
edited by
...