Ok awesome!
What if I wanted to force outgoing mail to choose a random mail server?
For example:
$servers = [
[
'host' => 'server1.example.com',
'username' => 'user 1',
'password' => 'password1',
],
[
'host' => 'server2.example.com',
'username' => 'user 2',
'password' => 'password2',
],
[
'host' => 'server3.example.com',
'username' => 'user 3',
'password' => 'password3',
],
];
//Pick a random server (or however you want to select a server)
$server = $servers[array_rand($servers)];
//Use the selected server values for mailing
$mail->Host = $server['host'];
$mail->Username = $server['username'];
$mail->Password = $server['password'];
The problem is, the mail is sent using the hostname which is not an actual user. I need it to send from a specific email account.
But I would also like to specify additional SMTP services to randomize the outgoing mail. I’ll put in like 10 pronto mail accounts.
-
This reply was modified 1 year, 10 months ago by azbce.
-
This reply was modified 1 year, 10 months ago by azbce.