On rare occasions my emails bounce back with the message:
Remote host said: 550-RFC2822 says that all mail SHOULD have a Message-ID header. 550 Most messages without it are spam, so your mail has been rejected.
I've tried setting a message-id header using:
IdMessage1.Headers.Values['Message-ID'] := id;
In this case id is a string in the format xxxxx at mydomain. However either that's not how to set a message-id header, or it's getting stripped by my smtp server (hosted by my isp.) I've noticed that emails sent from Outlook do get a message-id and they aren't stripped. Does anyone have any suggestions on how to supply the message-id header so it doesn't get stripped? Are there other headers that I should include as well? I've also emailed my isp in case it's a setting on their end but Outlook must do it somehow.