MailMessageReset Method |
Namespace: MailBee.Mime
This method allows processing multiple messages without re-creating MailMessage object for every message.
All information contained in the fields of the MailMessage object will be lost after using this method. Also, this method will delete any temporary files which could have been earlier created for this MailMessage object: although MailBee parses messages in memory, the developer may explicitly request automatic saving of the message as HTML file with MailMessage.Parser.AutoSaveHtmlMode property or using GetHtmlAndSaveRelatedFiles(String, VirtualMappingType, MessageFolderBehavior) method. Such temporary files are deleted by the object destructor and by Reset and Dispose methods.
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Mime; // The actual code (put it into a method of your class). MailMessage msg = new MailMessage(); msg.LoadMessage(@"C:\Docs\TestMail.eml"); Console.WriteLine(msg.Subject); msg.Reset(); Console.WriteLine(msg.Subject);