Email to send from a dedicated server with a different IP address

We have three domains hosted on a single dedicated server, each with its own dedicated IP address.

Domain A - contains the primary server IP (default server IP)
Domain B - has its own IP address
Domain C - has its own IP address

If the message is sent from domain B, then it uses the IP address of domain A in the outgoing, and it makes emails from domain B using PHP, directly to the Gmail spam box, etc.

Is there a way to change the source IP address depending on where the email is sent to in PHP? What must we change to fix this?

+3
source share
3 answers

This is not related to PHP.

No, you cannot spoof addresses as you suggest, but the reason emails are classified as spam is because you only received Host A published in your SPF. Just add the rest to the list of allowed senders:

"v=spf1 a:hostA.example.com a:hostB.example.com a:hostC.example.com"

WITH.

+1
source

You do not ask any details about setting up your server, so this cannot be answered. However, PHP can use the SMTP server to your liking. The easiest way to install this tool is for example PHPMailer .

IP-, , B MX, A ( IP) . , , Google, MX. , A.

0

PHP localhost MTA, IP-. , .

, , DNS- (MX A) , SPF DNS , , IP- .

0

Source: https://habr.com/ru/post/1741899/


All Articles