This project is read-only.

Save EML

Topics: Help requests
Feb 17, 2014 at 8:30 PM
I am having trouble saving an email in EML format.

Could post an example here to do this?
Coordinator
Feb 19, 2014 at 7:34 AM
Hi bresolin,

to get the message as EML, you can use the Message.ToEml method, as well as the Message.DownloadRawMessage (available in latest repository code). At the moment I'd recommend the second, as it's working best.

Greets,

Pavel
Feb 19, 2014 at 6:21 PM
Hi,

ToEml the method is also giving error "Object reference not set to an instance of an object."

I am listing the emails to the method Folders.Inbox.Search("UNSEEN").OrderByDescending(m => m.Date).ToList()

This same error occurs when using the methods message.Save ou SaveTo
Coordinator
Feb 20, 2014 at 5:35 PM
Hi bresolin,

before callng the Message.ToEml method, please consider downloading the message completely:
message.Download(MessageFetchMode.Full, true);
var eml = message.ToEml();
however, a better way is:
var eml = message.DownloadRawMessage();
Best regards,

Pavel