How to configure two SMTP Server for wordpress

Disclaimer: this is clumsy, someone might have a better suggestion. But here’s one idea:

  1. Leave WordPress configured with your [email protected] settings.
  2. Set up Woo with the [email protected] address (WooCommerce -> Settings -> Emails -> From Address).
  3. Hook woocommerce_mail_callback with your own function that temporarily hooks phpmailer_init to change the SMTP configuration before calling wp_mail.

Or perhaps you can skip step 3 if your SMTP server can be configured to allow an alternate “from” address for authenticated users.

And just a heads up: WooCommerce supplies its own forgot password and new account emails, so you’d need to decide whether you want to return those to their WordPress defaults, or just change them as well in step 3.