How to send emails for various domains from one central email server

Lets say we have domains of:

We want all their bulk emails sent by the main email server, lets call it, via related Php programs

How to do this to ensure that emails do not get flagged as being SPAM?

I mean typically you would set the DKIM, SPF & DMARK per domain. But in this case we are talking about a central mail server sending emails for zillions different domains.

How best to do that?

Would this do it?

$to      = '';
$subject = 'the subject';
$message = 'hello';
$headers = 'From:' . "\r\n" .
    'Reply-To:' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);


You’d have to be off your trolley to rely on PHP’s mail() function to send zillions of emails. You need something like PHPMailer.

Other than that, your code should work.

Gandalf, the Php programs that we use do not just dump Zillions of emails. But send them out like 25 at a time. So my question is will the above code send emails in such fashion that Big email providers such as Gmail will consider this email DKIM/SPF signed safe? When we will have DKIM/SPF/DMARK on the

and not on

while the recipient of that email when responding will respond to:


As I recall it, SPF just defines the mail servers that are legitimately allowed to send emails for your domains, so as long as you include all the mail servers on in your DNS / SPF configuration, it should be fine in that regard.


Thanks for your reply. Let me make the question more simple/clear.
So say we have 3 domains hosted on a dedicated server, they are:

They all of course use the same SMTP server to send out email.
Question then is:
do we need to have a different DKIM/SPF/DMARK for each of those domains for their emails considered to be safe? Or one DKIM/SPF/DMARK for the SMTP server will do?


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.