0 votes

This tutorial https://www.limilabs.com/blog/save-raw-eml-file-imap-pop3
shows how to save an email. But how do we load an email from a file?

I've tried:

Dim tMailBuilder As New MailBuilder
tMailBuilder.CreateFromEmlFile(fFile)

Where fFile is of course the file path of the previously saved eml file. However the properties of tMailBuilder are empty like .From or .CC.

I would rather save the file as HTML but even .LoadHtml() doesn't seem to work. The provided samples are lacking of so many information like how do we load a file?

by
edited by
Rude behavior will not be tolerated on this forum. Please mind your language.

1 Answer

0 votes

MailBuilder doesn't fill its internal properties in this case. CreateFromEmlFile returns new IMail instance.

You should use it in exactly the same way, you use it to parse mails, downloaded from an IMAP or POP3 server:

Dim email As IMail = New MailBuilder().CreateFromEmlFile(fFile)
Dim subject As String = email.Subject

I would rather save the file as HTML

Saving email as HTML makes no sense, as HTML format does not store attachments, headers, email's internal structure.

LoadHtml() doesn't seem to work.

I can assure you LoadHtml works. It fills MailBuilder.Html, MailBuilder.Text and MailBuilder.Visuals properties.

The provided samples are lacking of so many information like how do we load a file?

Almost every single sample contains this or very simmilar code (MailBuilder.CreateFromEml), It seem strange to me, that you missed the method's return value.

by (301k points)
edited by
...