Save original message to file

Nov 12, 2009 at 10:16 AM

Hello,

Is it possible to save the original message to file? (we want to backup the original emails we receive)

Thanks !

 

Coordinator
Nov 12, 2009 at 1:02 PM

It is possible.
Use Data property of Pop3Message class.

Pop3Client cl = new Pop3Client();
//set property to connect pop3 server
Int32 mailIndex = 1;
Pop3Message mg = cl.GetMessage(mailIndex);
String entireText = mg.Data;
System.IO.File.WriteAllText("C:\mailData.txt", entireText);

hope this help!

Nov 19, 2009 at 2:44 PM

Tnx, this works perfect!