• Hello,

    We are using your plugin when we installed a new plugin we made and we get this error.

    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.
    More info that may help – /var/www/html/wp-includes/pluggable.php:173

    How do I do I use PHP mail and your plugin?
    mail($to, $subject, $message, $headers);

    Thanks!
    Robb

Viewing 7 replies - 1 through 7 (of 7 total)
  • Does your plugin overide wp_mail?

    Thread Starter visual23

    (@visual23)

    Not that I know of. How does that happen?

    Thread Starter visual23

    (@visual23)

    I didn’t add anything to overide it. What would I look for?

    Thread Starter visual23

    (@visual23)

    I was using wp_mail but when I saw this error I switch to php mail thinking that was the issue.

    Thread Starter visual23

    (@visual23)

    Also, when I was building the plugin locally, Post SMTP wasn’t installed and wp_mail was working fine with my plugin. Thanks!

    Thread Starter visual23

    (@visual23)

    The plugin does use this.

    require_once( ABSPATH . “wp-includes/pluggable.php” );

    Thread Starter visual23

    (@visual23)

    I fixed the issue. Our plugin calls a function in another plugin like so.
    require_once( ABSPATH . ‘/wp-content/plugins/rewardsystem/includes/main_functions_for_point_expiry.php’ );

    When the page loaded I got this error. ‘Fatal error: Call to undefined function is_user_logged_in()’. Someone in a search said to add this ‘require_once( ABSPATH . “wp-includes/pluggable.php” );’ and that did solve the issue for me.

    I ended up copying ‘pluggable.php’ to our plugin and removing the wp_mail function. Seems hacky eh?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Sending mail with PHP mail’ is closed to new replies.