I have multiple websites running on my server: domain1.com and domain2.com
The problem is now that when I sent an email via ASP.NET from domain2.com
, that in this email source I see (notice domain1
):
Received: from mail.domain1.com (h2134215.myisp.com. [81.112.2.12)
Received: from h2134215 ([81.112.2.12]) by domain1.com with MailEnable ESMTPA; Sat, 21 Jun 2021 22:17:29 +0200
Message-ID: <[email protected]>
I'm using Mail Enable to send emails via ASP.NET like so:
Dim mailObj As New SmtpClient
mailObj.Host = localhost
I also tried:
Dim mailObj As New SmtpClient
mailObj.Host = "smtp.domain2.com"
Dim basicAuthenticationInfo As New System.Net.NetworkCredential("[email protected]", "mypassword")
mailObj.UseDefaultCredentials = False
mailObj.Credentials = basicAuthenticationInfo
In both cases my emails are sent.
Looking at my SMTP settings in MailEnable
[General] tab
Local domain name: domain1.com
Default mail domain name: mail.domain1.com
This is causing my emails to be rejected by some mailservers as spam.
How can I configure Mail Enable to use the correct email headers that match the domain from which I'm sending, domain2
in this case?
UPDATE 1
DNS settings