awesomemotive / WP-Mail-SMTP

The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 3 million sites.
https://wordpress.org/plugins/wp-mail-smtp/
GNU General Public License v3.0
55 stars 35 forks source link

Woocommerce From Name Fail #61

Closed frcweb closed 4 years ago

frcweb commented 4 years ago

Using Google SMTP, I have tried multiple methods but none work.

  1. Set From Name in Gmail settings
  2. Set From Name using wp filter and hard coding
  3. Set From Name in woocommerce email settings
  4. Set From Name in WP MAIL SMTP

The From Name works in Email Test for WP MAIL SMTP. It will show My Site noreply@mysite.com

The From Name FAILS for emails sent from woocommerce orders. It displays the name of the email address ‘noreply’ in this case.

So it looks like the Google API does give permission. So what is going on?

slaFFik commented 4 years ago

Google API does not give permissions. They do a weird amount of checks, and from what I found the last time I investigated the issue is that local sites may display properly defined FROM Name/Email, while real sites do not. It looks like Google tries to access the site while sending the email, and if it can't (local site) - it fails its own checks and pass-through FROM Name. On a live site that was not possible.

Also, I have a suspicion that they are changing their own behavior in their API from time to time, which results in different behavior of the FROM Name header.

The last resort that you can try - use the Force From Name option. If it doesn't help - there is no other way we control that. In the recent release of the plugin we've changed the priorities of when we redefine FROM Name/Email, so if it doesn't help, we are out of luck.

Meanwhile, I'm closing the issue, as there is nothing more that we can do right now.