I am just checkin with our development team where we are on this.
@ashleighm How do you conclude that it is WP Optimize that causes the issue? Yes, WP Optimize uses wp_mail but it is not declaring it.
See the screenshot: https://prnt.sc/3SEqUoq6cDQv
In my case, it is Mailgun plugin that declares wp_mail Disabling it solves the issue.
@webulous Because in testing when I deactivate the wp optimize plugin I no longer get the “FATAL Postman: Postman: wp_mail has been declared by another plugin or theme, so you won’t be able to use Postman until the conflict is resolved.” in my error log on every page load and bot crawl.
https://ibb.co/QPTZxSH
I don’t have the mailgun plugin. I’ve never heard of it.
@ashleighm It doesn’t have to be MailGun Any other plugin that deals with sending email such as mailin by sendinblue or CF7
See here https://ww.wp.xz.cn/support/topic/wp_mail-declared-by-another-plugin-theme/
If you have enabled Log events to email in Logging settings in WPO, try removing it.
I don’t use any other plugin that alters the way the core sends mail.
In testing, the error message goes away when I deactivate WP Optimize. The error message persists when switched to 2022 theme and only Post SMTP and WP Optimize are active, and all other plugins are deactivated.
The error does not include more information or a url to where wp_mail is being declared like in your screenshot.
I have gone through similar threads in the Post SMTP forum and don’t have any code in my config file. I do have an open support thread with them as well.
@ashleighm Could you please comment out this line and see if that fixes issue? https://plugins.trac.ww.wp.xz.cn/browser/post-smtp/trunk/Postman/extra/no-localhost-mails.php#L8
If there are no other plugins, except WPO and Post SMTP, then probably post smtp wrongly conclude cached site as localhost and define wp_mail
Mere existence of wp_mail sets $this->bindError as true
As I said earlier, WP Optimize don’t declare function wp_mail which you can test by searching the source code. You are saying that no other plugins are there and theme as well doesn’t declare it. So above is the only possibility I see
Removing that line didn’t have an effect.