aspNetEmail

EmailMessage.MessageId Property

Sets the MessageId of the email.

public string MessageId {get; set;}

Remarks

Only for advanced users. If this property is not set correctly, some spam filters will detect this abnormality, and declare an email sent as spam. If this property is not set, aspNetEmail will properly configure and set it correctly.

Example

[C#]
EmailMessage msg = new EmailMessage( "mail.myCompany.com");
msg.Subject = "Order Confirmation";
msg.To = "you@yourcompany.com";
msg.From = "me@myCompany.com";

//logging for easier troubleshooting
msg.Logging = true;
msg.LogPath = "c:\\email.log";

//set the plain text body
msg.Body  = "the email body contents go here...";

//set the message id so it can be used in any bounce campaign parsing
//any bounces will be tied back to Campaign1
msg.MessageId = "<Campaign1-" + Guid.NewGuid().ToString() + ">";
msg.Send();
		
		
		
[VB.NET]
Dim msg As New EmailMessage("mail.myCompany.com")
msg.Subject = "Order Confirmation"
msg.To = "you@yourcompany.com"
msg.From = "me@myCompany.com"

'logging for easier troubleshooting
msg.Logging = True
msg.LogPath = "c:\email.log"

'set the plain text body
msg.Body = "the email body contents go here..."

'set the message id so it can be used in any bounce campaign parsing
'any bounces will be tied back to Campaign1
msg.MessageId = "<Campaign1-" + Guid.NewGuid().ToString() + ">"
msg.Send()
		
		

See Also

EmailMessage Class | aspNetEmail Namespace