MailMergeReplace Method (String, String, MailMergeTargets) |
Replaces all occurrences of the specified case-sensitive pattern in the specified parts of the message with the actual value.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public int Replace(
string pattern,
string actualValue,
MailMergeTargets targets
)
Public Function Replace (
pattern As String,
actualValue As String,
targets As MailMergeTargets
) As Integer
Parameters
- pattern
- Type: SystemString
The pattern to be searched. - actualValue
- Type: SystemString
The actual value to replace the found pattern with. - targets
- Type: MailBee.MimeMailMergeTargets
The elements of the message where the pattern text should be searched and replaced with the actual value.
Return Value
Type:
Int32The number of replacements actually made.
Remarks This method performs search and replace operation in targets parts of the message.
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 |
---|
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 See Also