Converts the EmailMessage object to a byte array.
The EmailMessage as a byte array.
[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...";
//convert the email message to a byte array, and save to sql server
byte[] data = msg.ToByteArray();
//a method that saves to sql server
SaveToSql( data );
[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..."
'convert the email message to a byte array, and save to sql server
Dim data As Byte() = msg.ToByteArray()
'a method that saves to sql server
SaveToSql(data)