MailMessageSetUniqueMessageID Method
Sets a new unique value of Message-ID header and returns it.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public string SetUniqueMessageID(
	string domain
)

Parameters

domain
Type: SystemString
The domain name to be put in the MessageID field. If a null reference or an empty string, the local computer name is used.

Return Value

Type: String
A string containing the new unique value Message-ID value (with angle brackets).
Remarks

Message-ID value is composed of the current thread ID + "." + the random string + "@" + the domain name. This value is then enclosed in angle brackets (<>) and assigned to MessageID property.

You can set Message-ID value manually using MessageID property.

Note Note
MailBee automatically sets unique Message-ID value when the mail message is being sent (or submitted to the pickup folder) unless MailMessage.Builder.SetMessageIDOnSend property is set to false.
Examples
This sample creates a new message and sets its Message-ID.
// 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)
MailMessage msg = new MailMessage();
Console.WriteLine(msg.MessageID);
msg.SetUniqueMessageID("afterlogic.com");
Console.WriteLine(msg.MessageID);
See Also