MessageBuilderConfigApply Method
Rebuilds the message accordingly the current settings.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public void Apply()
Remarks

The Builder properties which affect building the message should be set BEFORE using this method. Otherwise, these options won't take effect.

Normally, there is no need to call this method since MailBee automatically applies the current Builder settings when building the MIME source of the message from its properties and collections. You should, however, call this method if you need to get the results of buiding the message without saving it into a file, sending it, etc. For instance, if you configured MailBee to generate plain-text version of the HTML body during building the message (actually, this convesion is turned on by default), you may want to get this plain-text version for some reason (i.e. you are not going to send the message now, you need this plain-text version itself). In this case, it's enough to call Apply method.

Internally, Apply method just calls GetMessageRawData method of the parent MailMessage object but does not return any value.

Examples
This sample creates a new message, loads HTML message body from HTML file, and generates plain-text body from the HTML body. The sample demonstrates that the plain-text body won't be generated until the message gets built (which occurs either when the MIME source of the message needs to be generated or when Apply method is called).
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

// The actual code (put it into a method of your class)

// Load the message body from HTML file.
MailMessage msg = new MailMessage();
msg.LoadBodyText(@"C:\Docs\index.htm", MessageBodyType.Html);

// Show the empty plain-text message body.
Console.WriteLine(msg.BodyPlainText);
Console.WriteLine("---------------------------------------");

// Build the message. Plain-text version will be created at this moment.
msg.Builder.Apply();

// Show the generated plain-text message body.
Console.WriteLine(msg.BodyPlainText);
See Also