MailMessageForwardAsAttachment Method
Forwards a mail message as attached .EML file.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public MailMessage ForwardAsAttachment()

Return Value

Type: MailMessage
A new MailMessage object containing the message as attached .EML file.
This method constructs a new e-mail message and adds original message as an attachment, all other fields of the new message remain empty (such as Subject, Body, To, Cc and Bcc fields, etc).
This sample loads the message from .EML file, forwards it as attachment and sends the resulting message out.
using MailBee;
using MailBee.SmtpMail;
using MailBee.Mime;

class Sample
    static void Main(string[] args)
        // Load the message from file.
        MailMessage msg = new MailMessage();

        // Create a new message having the forwarded message as attachment.
        MailMessage newMsg = msg.ForwardAsAttachment();

        // Set up other fields of the envelope message.
        newMsg.From.AsString = "John Doe <>";
        newMsg.To.AsString = "Alice <>";
        newMsg.Subject = "Forwarded message";
        newMsg.BodyPlainText = "The message is attached.";

        // Send it.
See Also