Postman: wp_mail has been declared by another plugin or theme

(I know this is a late answer, so this user has probably moved on; but I’m answering this in the hopes that if a future user ends up here seeking a similar solution, that the following will help them find it.)

The problem that Postman is telling you about is that the function wp_mail() has already been declared as a function, so it cannot be redeclared.

What you need to locate is a plugin that has declared wp_mail() as a function. The two example files you gave do not declare it as a function. Those files are using the function, which is fine.

What you need to find is a file that declares function wp_mail() {...

The first test you need to do in this kind of situation is deactivate all plugins. If the problem goes away, then reactivate plugins one-by-one and retest until you locate the conflicting plugin. Once you’ve narrowed down the offending combination, then you can develop a course of action.

If the only reason you’re using Postman in this case is to send email via SMTP, then it may be easier to seek another possible solution. You can do it without a plugin, and without redeclaring wp_mail(). There are also other plugin solutions that you could try.

Leave a Comment