Mail Enable email headers when sending emails via ASP.NET
Solution 1:
Consistent host name is enough, you do not have to aim for matching domains between host and the mail it handles. Just make sure your server is not saying it is called mail.domain1.com
while according to DNS, it is called h2134215.myisp.com
.
How can I configure Mail Enable to use the correct email headers?
These trace headers are added by the next server, merely recording what has happened. They automatically record the new host name and PTR record as soon as you configure it. Consider them a symptom.
match the domain from which I'm sending
Your canonical server name should remain the same, regardless of which domain you are sending mail for. Thus, it cannot match two different domains. But it does not have to. You just have to configure one name, properly.
This is causing my emails to be rejected by some mailservers as spam.
Set the mail servers fully-qualified domain name to something that seems appropriate for both domains (could be mail.domain1.com
, could be something entirely different from both domains) and register that hostname in DNS, preferably in both directions.
Then deploy SPF to let receiving servers automatically know which mail servers are authorized to send mail for which domains.