I want to send a mail from a website. The mail server from this domain is not publicly reachable, so I can't use that to send the mail.
The webserver that hosts the website has another email server that I can/have to use. But I want the FROM to be the website domain.
How can I set this up without my mails being marked as spam for claiming to be from the website domain when the mail server that sent it is not.
Not sure if I am clear. Maybe an example helps:
domain: a.com
domain mail server: a.com (e.g. mail@a.com - can't use that mail server for sending)
webserver mail server: mail.customer123.somehoster.com (can only use that server)
So I want to send a mail via the mail.customer123.somehoster.com
mail server but the sender should appear to be mail@a.com
. I understand that this looks like spam mail to most servers. What's the correct way to set this up?
So far I've read that a SPF record on the DNS is all I need. Is that correct? Is that the best practice? Can some help me with the correct entry?