• Resolved very

    (@ziriuz)


    Hello!

    The wp_mail function should return true if the email was successfully sent.
    Looking at the code, it looks like the plugin’s wp_mail function will never return true, the value it returns primarily depends on the return value of send() method of the Mail class. Looking at that method, there’s no return statement inside that try{} statement.

    Hopefully, you can take a look.

    Regards,

Viewing 1 replies (of 1 total)
  • @ziriuz, this is incorrect. There is a return on the try block – it has a finally() catch at the end which returns false if successfully sent (for reasons explained in the code comments). The wp_mail override function knows that a false return means success. If the return value is true, wp_mail knows that this is because an error message has been returned and it processes that accordingly.

Viewing 1 replies (of 1 total)

The topic ‘wp_mail never returns true’ is closed to new replies.