What can be frustrating something sometimes is when you email is bounced back by the receiving party's email server stating that the message could potentially be spam. You will typically receive an email back with something along the lines of: "[Return Code 550] sid: RandomSIDHere :: High probability of spam".
Incoming mail servers typically check for a "Message-Id" header as part of the email. Email clients use this to track the thread of the message among other things. You can read more about Message-Id here.
We can attach a Message-Id attribute to our outgoing mail messages in C# with one very simple line of code (Where 'mail' is a MailMessage object)
Code Snippet
- mail.Headers.Add("Message-Id", string.Format("<{0}@{1}>", Guid.NewGuid().ToString(), "yourdomain.com"));
End of Code Snippet
No comments:
Post a Comment