Hello,
I'm trying to find a solution in order to be able to use more than one SMTP server at once with my newsletter application (written in PHP of course).
The scenario is that we have 3 SMTP servers that we're using to send emails from.
All of the emails are personalized (with name, surname, etc..).
There's a command line script that cycles through the newsletters that have to be sent, looks up the individual email addresses and other data and then starts sending them out.
At the moment it's just cycling through the three servers and using the phpmailer class to send the mail. What happens is that with every send, the script has to wait for the communication with the SMTP server to be done. This means that the other 2 servers in the meanwhile are just sitting there and waiting.
I would like to use all three at the same time and sort of check which one is free and use it. That way, if one of the servers is already overwhelmed and is answering slowly, I can be sure that I am still using the other 2 efficiently.
I originally thought about using multithreading which is the most natural approach to this kind of situation.. but since PHP does not support it natively I'm in a bit of stall as to what to try out.
Any suggestions?