aspNetEmail

ForwardReplyEmail.ToEmailMessage Method 

Returns the EmailMessage that can be used for sending.

public EmailMessage ToEmailMessage();

Example

[C#]
            //the following example creates an email for forwarding
            ForwardEmail fe = new ForwardEmail();
            
            //load the email message that will be sent a reply
            fe.LoadFile( "c:\\temp\\original.eml" );
            
            //set the body text found inline
            fe.BodyText( "Please see the messsage below...");
            
            //work with the EmailMessage that was created for forwarding
            //this message is formatted just like an email in a mail client
            EmailMessage forwardedMessage = fe.ToEmailMessage();
            forwardedMessage.Server = "mail.example.com";
            forwardedMessage.FromAddress ="me@example.com";
            forwardedMessage.To = "you@yourcompany.com";
            
            forwardedMessage.Send();
            
[VB.NET]
             'the following example creates an email for forwarding
            Dim fe As New ForwardEmail()
            
            'load the email message that will be sent a reply
            fe.LoadFile("c:\temp\original.eml")
            
            'set the body text found inline
            fe.BodyText("Please see the messsage below...")
            
            'work with the EmailMessage that was created for forwarding
            'this message is formatted just like an email in a mail client
            Dim forwardedMessage As EmailMessage = fe.ToEmailMessage()
            forwardedMessage.Server = "mail.example.com"
            forwardedMessage.FromAddress = "me@example.com"
            forwardedMessage.To = "you@yourcompany.com"
            
            forwardedMessage.Send()
            
            

See Also

ForwardReplyEmail Class | aspNetEmail Namespace