aspNetEmail

EmailMessage.ToString Method 

Returns a string representation of the formatted EmailMessage

public override string ToString();

Return Value

A string representation of the formatted EmailMessage

Example

[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 string, and save to sql server
            string contents = msg.ToString();
            
            //a method that saves to sql server
            SaveToSql( contents );
            
[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 string, and save to sql server
            Dim contents As String = msg.ToString()
            
            'a method that saves to sql server
            SaveToSql(contents)
            
            

See Also

EmailMessage Class | aspNetEmail Namespace