MailMergeReplace Method (String, String)
Replaces all occurrences of the specified pattern in the message template with the specified actual value.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public int Replace(
	string pattern,
	string actualValue
)

Parameters

pattern
Type: SystemString
The pattern to be searched.
actualValue
Type: SystemString
The actual value to replace the found pattern with.

Return Value

Type: Int32
The number of replacements actually made.
Remarks

This method performs search and replace operation in ALL parts of the message. If it's desired to only limit the scope of search and replace operation to certain message only (such as message headers only), use Replace(String, String, MailMergeTargets) overload.

If you previously added an attachment pattern (using method) which contains pattern in its value, pattern will be replaced with the actualValue in the attachment pattern and the resulting value will be used as a path to the file to be attached to the message.

Note Note
Pattern of the message template is case-sensitive. For instance, if the pattern is e-mail and the message body contains E-MAIL and e-mail, then only e-mail will be replaced with the actual value.
Examples
The example is available in MailMerge topic.
See Also