Exports EmailMessage object to string. Can be used to save emails as text files.
This sample shows how to use the ToString() method to save emails from POP3 server as .eml files
ForAspNet.POP3.License.LicenseKey = "<put license string here>";
POP3 objPOP3 = new POP3("mail.server.com", "login", "password");
objPOP3.Connect()
if (objPOP3.IsAPOPSupported)
objPOP3.SecureLogin();
else
objPOP3.Login();
objPOP3.QueryServer();
for (int i = 1; i <= objPOP3.TotalMailCount; i++)
{
EmailMessage objEmail = objPOP3.GetMessage(i, false);
StreamWriter sw = new StreamWriter(@"c:\\pop3\m_" + objEmail.GetCustomHeader("Message-ID") + ".eml");
sw.Write(objEmail.ToString());
sw.Close();
}
objPOP3.Close();
EmailMessage Class | ForAspNet.POP3 Namespace