Write email contents to a file.


The LocalFile property can be used to instruct the component to save the message being retrieved to a specified file.

When using the POP component, the IncludeHeaders property can optionally be used to instruct the component to include the headers when writing the file. So, something like this:

pop1.LocalFile = "C:/temp/email.txt"; pop1.IncludeHeaders = true; pop1.Retrieve();
When using the IMAP component, this same functionality is available via the IncludeHeaders configuration setting:

imap1.LocalFile = "C:/temp/email.txt"; imap1.Config("IncludeHeaders=true"); imap1.FetchMessageText();

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.