Saves the EmailMessage to a stream.
[C#]
EmailMessage msg = new EmailMessage( "mail.myCompany.com");
msg.FromAddress = "me@myCompany.com";
msg.To = "You@YourCompany.com";
msg.Subject = "test email";
msg.Body = "enter your body contents here...";
//save the message to a file
FileStream fs = File.OpenWrite( "c:\\temp\\sample.eml" );
msg.SaveToStream( fs );
fs.Flush();
fs.Close();
[VB.NET]
Dim msg As New EmailMessage("mail.myCompany.com")
msg.FromAddress = "me@myCompany.com"
msg.To = "You@YourCompany.com"
msg.Subject = "test email"
msg.Body = "enter your body contents here..."
'save the message to a file
Dim fs As FileStream = File.OpenWrite("c:\temp\sample.eml")
msg.SaveToStream(fs)
fs.Flush()
fs.Close()