ComponentPro UltimateMail

Loading an existing message

Language Filter: AllSend comments on this topic to ComponentPro

With UltimateMail component, you can quickly create a new message from many sources such as from local disk file or data stream. The following sample illustrates how to create load an existing message (.EML). From version 5.0, Ultimate Mail can also load Outlook MSG file format.

using System;
using ComponentPro.Net.Mail;

...

// Create a new instance of the MailMessage class.
MailMessage msg = new MailMessage("c:\\temp\\my message.eml");

// ... 
 
// Add recipient to it.
msg.To.Add("someone@somedomain.com");

// ... 
 
// Load an Outlook MSG file
msg = new MailMessage("c:\\temp\\my outlook message.msg");
msg.Subject += " - Test";