MailBee.NET Objects 4.0

MessageBuilderConfig.AddressDelimeter Property

Gets or sets the character to be used as a delimiter for e-mail addresses.

public AddressDelimeterChar AddressDelimeter {get; set;}

Property Value

An AddressDelimeterChar value representing the delimiter character.

Remarks

This property allows the developer to select a comma (",") or semicolon (";") character to be used as a delimiter for e-mail addresses when composing e-mail address strings consisting of multiple e-mail addresses. The default value is Comma.

This property has no effect on parsing e-mail address strings. During parsing, MailBee accepts both comma and semicolon as valid delimiters.

Note   MessageBuilderConfig object cannot be used on its own. To access its members, the developer should use MailMessage.Builder property.

Example

The sample creates a new message, sets two recipient e-mail addresses, and demonstrates the effect of changing the delimiter character.

[C#]
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

// Create a new MailMessage object.
MailMessage msg = new MailMessage();

// Add message recipients.
msg.To.Add("jdoe@domain.com");
msg.To.Add("bill@domain.com");

// Set semicolon as a delimiter character.
msg.Builder.AddressDelimeter = AddressDelimeterChar.Semicolon;

Console.WriteLine(msg.To.AsString);

// Set comma as a delimiter character.
msg.Builder.AddressDelimeter = AddressDelimeterChar.Comma;

Console.WriteLine(msg.To.AsString);
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.Mime

' Create a new MailMessage object.
Dim msg As New MailMessage

' Add message recipients.
msg.To.Add("jdoe@domain.com")
msg.To.Add("bill@domain.com")

' Set semicolon as a delimiter character.
msg.Builder.AddressDelimeter = AddressDelimeterChar.Semicolon

Console.WriteLine(msg.To.AsString)

' Set comma as a delimiter character.
msg.Builder.AddressDelimeter = AddressDelimeterChar.Comma

Console.WriteLine(msg.To.AsString)

See Also

MessageBuilderConfig Class | MailBee.Mime Namespace | MailMessage