最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - How to configure two SMTP Server for wordpress

programmeradmin6浏览0评论

What I need is :

I need to send transactional e-mails from two SMTP configurations.

All WooCommerce side of e-mails should send from [email protected]. Example: order summary, delivery status.

All WordPress user side of e-mails should send from [email protected]. Example: Forget password e-mail, account creation e-mail.

Note: All methods are working. I just want to send different e-mails from their respective purpose.

What I need is :

I need to send transactional e-mails from two SMTP configurations.

All WooCommerce side of e-mails should send from [email protected]. Example: order summary, delivery status.

All WordPress user side of e-mails should send from [email protected]. Example: Forget password e-mail, account creation e-mail.

Note: All methods are working. I just want to send different e-mails from their respective purpose.

Share Improve this question edited Jul 3, 2019 at 1:07 user3135691 1,0359 silver badges15 bronze badges asked Jul 1, 2019 at 14:56 VarunaVaruna 133 bronze badges 2
  • Are you really sending from two different domains i.e maydomain and mydomain? If it’s a typo you should update your question title, because you’re not trying to configure two SMTP servers, but rather two From addresses which is a lot simpler – Andy Commented Jul 2, 2019 at 19:41
  • @Andy that was a typo. Sorry about that. But this not about from addresses. Same domain but I have two SMTP servers (main smtp server and marketing smtp server. Marketing smtp server is optimized send bulk emails) – Varuna Commented Jul 5, 2019 at 10:08
Add a comment  | 

1 Answer 1

Reset to default 1

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.

发布评论

评论列表(0)

  1. 暂无评论