I want to send mails using wp_mail
function. I have multiple SMTP accounts login details. I want to send some mail using Account A and some using Account B. How can I send mails with different accounts? I saw phpmailer_init
but it cannot be changed once set.
phpmailer_init
will fire just before a message is sent, every time. You'll be fine to use that hook & change your SMTP settings on-the-fly, depending on whatever conditions.