Jump to content

Configure Multiple MTAs for Email sender Script using Mail function


Recommended Posts



Can someone advise or provide an example PHP script where I can create (based on a pool of five dedicated IP addresses I have assigned to a virtual private server) so that I can - via MySQL table - assign one of those five ip addresses to each 'outgoing' email being sent using the mail function?


I've searched the Net and found nothing that really explains how to do this and no examples.

Would appreciate any insight to help me figure out this solution.


I know its possible b/c apps like Interspire & PowerMTA does it and you can assign the block of IP's via their app's GUI - just saying, i know its possible.

I found some info regarding Postfix and EXIM but nothing in details - reason I'm asking for help here to figure this out...


Objective: I just want to set (rotate) the ip addresses - that's bound to that server - as each 'outbound' email is being sent out from said server.




Link to comment
Share on other sites

You can't "assign" an IP address to an email. What you do is have each of those servers configured to send email, which means installing appropriate MTA software and then doing whatever it takes to get the email message to those servers to be sent.


The MTA software is basically up to you. Postfix and EXIM are two of the big ones that can do it.


The other half depends - you haven't really given any requirements besides "send from multiple servers"...


You mentioned MySQL? And you're posting on a PHP forum? You can set up a PHP-based cronjob on each server that scans the database for emails that it should send and then sends them.


foreach (/* get list of emails from the database */ as $email) {
	mail($email["to"], $email["subject"], $mail["message"], $mail["headers"]);
as a very basic example. More appropriate would be to install something like PHPMailer and use that to send the emails instead of mail(), because it can do a better job of it.



But this whole thing is weird. Why bother with assigning specific servers? If they're all sending on behalf of the same domain then it doesn't really matter.

Link to comment
Share on other sites

Hi & thanks for response.

Maybe my initial comments a bit unclear but you gave me the insight i needed to make this work.

Yes, I've concluded i need MTA software to manage the MTA (pools of ip's) and this setup is not for a fourm but a 'bulk email server' which sending currently 1/2 million or more transactional emails, monthly.

I've figured it out - thanks for your response.




Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.