I have installed a server mail in a dedicated server and I have PowerMTA installed also, our server has a main IP address and 50 additional ones,Multiple VMTA are configured. Now I need to send email with php through PowerMTA and be able to choose each time a different IP. I know I have to use PHPMailer or another library but I do not have any idea on how to send emails via PowerMTA and choose the IP or the vmta (contain the IP and the domain) to use.
Any help would be much appreciated
Thank you
You will need to refer to the PowerMTA documentation for this, which is not officially available online (see chapter 8).
You select a specific virtual MTA in PowerMTA by setting a custom message header called
x-virtual-mtawhen you submit messages to the MTA, which is done usingaddCustomHeaderin PHPMailer, passing whatever name you need to use for your VMTA:You need to ensure that your source IP is permitted to select VMTAs via this method in your PowerMTA config, for example:
I would avoid embedding IP addresses in your code; stick to using VMTA names.