wp_mail is declared

When I active this plugin, I get a message from Sendgrid, my mail sending plugin, saying that wp_mail is already defined and so Sendgrid can’t work.

I don’t think it’s necessary for this plugin to declare wp_mail, so it would be great if that can be removed or made optional.

2 thoughts on “wp_mail is declared

  1. the support admin Post author

    That plugin is plain wrong in its message.

    I only call the default WordPress wp_mail function once, I never define OR declare a new function:

    Find operation on wp_mail in the whole plugin:
    ramon@devbak01:~/www/wordpress_plugins/svn_dir/auto-prune-posts/tags/1.6$ find -name ‘*.php’ -exec grep ‘wp_mail’ {} +

    Results in:
    ./auto-prune-posts.php: wp_mail($this->conf[‘settings’][‘admin_email’],’Plugin auto prune posts notification’,$body);

  2. the support admin Post author

    Update: I am quite confident that the other plugin tries to create a function wp_mail() using pluggable.

    Although it fails to apply this before the pluggable is loaded. So this other plugin must create a PHP file in mu-plugins folder to create its wp_mail function.

    Keep in mind: i do not create the wp_mail function, but I include pluggable in the /wp-admin so not on the frontend website.

    So .. as it appears my plugin is creating a wp_mail function the other plugin is in error while not keeping in mind that an unlimited number of other plugins might be loaded first and can include pluggable.


Leave a Reply

Your email address will not be published. Required fields are marked *