Export Message

Feb 17, 2014 at 9:31 AM
Is it possible to export a message like .eml or .msg (as backup) ?

After is it possible read this files ?
Coordinator
Feb 17, 2014 at 10:43 PM
Yes you can.
See MailMessage class.

Documentation is here.
https://higlabo.codeplex.com/documentation

//Create MailMessage object from .eml file
String text = File.ReadAllText("C:\MyMail.eml");
var mg = new MailMessage(text);
Feb 18, 2014 at 6:34 AM
Edited Feb 18, 2014 at 7:06 AM
And how to save a message to .eml ? (also with attaches)

PS: I don't found on Documentation page ..
Coordinator
Feb 18, 2014 at 7:10 AM
MailMessage mg = ...;
File.WriteAlltext("C:\Temp", mg.BodyData);

Perhaps, BodyData property or other.
That property has raw data of mail.
Or you can get Text by GetMessageText method of Pop3Client(or ImapClient) class.


regards.