Title: incorrect &#8220;wp_mail&#8221; function location
Last modified: July 17, 2022

---

# incorrect “wp_mail” function location

 *  Resolved [epiron](https://wordpress.org/support/users/epiron/)
 * (@epiron)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/)
 * Hi,
 * The plugin shows the following message:
 * WP Mail SMTP has detected incorrect “wp_mail” function location. Usually, this
   means that emails will not be sent successfully!
 * What does it mean and what do I have to do to fix it?

Viewing 15 replies - 16 through 30 (of 31 total)

[←](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/?output_format=md)
[1](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/?output_format=md)
2 [3](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/3/?output_format=md)

 *  Plugin Author [Gregor Capuder](https://wordpress.org/support/users/capuderg/)
 * (@capuderg)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-15899612)
 * Hi [@belenberrueta](https://wordpress.org/support/users/belenberrueta/),
 * as discussed in previous messages, this admin notice is not causing any email
   sending issues. It’s just checking if the WordPress core function `wp_mail` has
   a different file path than expected.
 * It is currently showing up for you, because we have a bug for sites hosted on
   Windows servers. This will be fixed in the next version. And if you want, you
   can disable the notice with the code snippet mentioned in my previous messages.
 * Please [read this blog post](https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/)
   if you want to know how to add custom PHP code to your WP site.
 * Take care!
 *  [belenberrueta](https://wordpress.org/support/users/belenberrueta/)
 * (@belenberrueta)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-15899766)
 * Thanks Gregor!
 * But this error appeared only in the sites I updated the plugin…in the older versions
   the mails are still working.
 * When testing the email, the following message appears:
    “SMTP ERROR: Failed to
   connect to server (0)SMTP Error: Could not connect to SMTP host.
 * But the curious thing is that the email and server information are OK.
 * How can I solve it?
 * Thanks again!!!
 *  Plugin Author [Gregor Capuder](https://wordpress.org/support/users/capuderg/)
 * (@capuderg)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-15899790)
 * Hi [@belenberrueta](https://wordpress.org/support/users/belenberrueta/),
 * if you have an actual email sending problem, please open a new [support ticket here](https://wordpress.org/support/plugin/wp-mail-smtp/#new-topic-0).
   We will help you out with your email sending issue in that separate thread. When
   you are opening a new support ticket, please provide as much details as possible(
   without sharing any personal information – this is a public forum), so we can
   help you out as fast as possible.
 * The admin notice that is discussed in this thread was introduced in our latest
   version, that’s why you don’t see it on other sites that you didn’t update. Or
   you might not be using Windows as your hosting platform on those sites.
 * Take care!
 *  Plugin Author [Gregor Capuder](https://wordpress.org/support/users/capuderg/)
 * (@capuderg)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-15923725)
 * Hey everyone,
 * we just released a new version: v3.5.2, which also contains the fix for the “
   incorrect `wp_mail` function location” notice being displayed on Windows servers.
 * Please update to the latest version and remove the custom code [referenced here](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/#post-15837497),
   if you added it to your site.
 * Thank you for your patience and understanding.
 * Have a nice day!
 *  [huckster](https://wordpress.org/support/users/huckster/)
 * (@huckster)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16005353)
 * I’m having the same issue:
 * WP Mail SMTP has detected incorrect “wp_mail” function location. Usually, this
   means that emails will not be sent successfully!
 * Current function path: /wp-includes/pluggable.php:182
 * Wordpress 6.0.2
    Plugin version: 3.5.2
 *  Plugin Author [Gregor Capuder](https://wordpress.org/support/users/capuderg/)
 * (@capuderg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16005911)
 * Hi [@huckster](https://wordpress.org/support/users/huckster/),
 * could you please let me know the whole error message you get, with the full file
   path?
 * Are you experiencing this issue locally or on your web hosting server? Is it 
   a Windows or Linux server?
 * Could you also please help us and check the values of these PHP and WP constants
   on your site:
    – DIRECTORY_SEPARATOR – ABSPATH – WPINC
 * Take care!
 *  [huckster](https://wordpress.org/support/users/huckster/)
 * (@huckster)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16008999)
 * Hi Gregor – thanks for the reply – It’s a Linux server, PHP v7.4.19 – it’s a 
   hosted solution.
 * I get this info when I open the plugin page:
    “WP Mail SMTP has detected incorrect“
   wp_mail” function location. Usually, this means that emails will not be sent 
   successfully!
 * Current function path: /wp-includes/pluggable.php:182″
 * Also – this error appeared when I upgraded the WordPress from 5.8.x to 6.0.x.
 * How can I check these constants?
 * Thanks!
 *  Plugin Author [Gregor Capuder](https://wordpress.org/support/users/capuderg/)
 * (@capuderg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16009323)
 * Hi [@huckster](https://wordpress.org/support/users/huckster/),
 * it’s strange that the path does not include a full path, just the ending.
 * You can get the information about the ABSPATH constant in Tools > Site Health
   > Info (tab) > WordPress Constants (section).
 * For the other two constants, you can contact your hosting support.
 * Take care!
 *  [huckster](https://wordpress.org/support/users/huckster/)
 * (@huckster)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16009414)
 * ABSPATH //
    WP_HOME Undefined WP_SITEURL Undefined WP_CONTENT_DIR //wp-content
   WP_PLUGIN_DIR //wp-content/plugins
 *  Plugin Author [Gregor Capuder](https://wordpress.org/support/users/capuderg/)
 * (@capuderg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16009452)
 * Hi [@huckster](https://wordpress.org/support/users/huckster/),
 * Hmm, this looks strange. I think the issue is a specific hosting setup. It’s 
   causing issues, when we try to compare the paths for the wp_mail function location.
 * Your emails are sending just OK, right?
 * I think for your case it’s best to ignore this admin notice and if you want to
   remove it, you can use this code snippet:
 *     ```
       add_filter( 'wp_mail_smtp_core_wp_mail_function_incorrect_location_notice', '__return_false' );
       ```
   
 * You can read here on [how to add PHP code snippets to your WP site](https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/).
 * Have a nice day!
 *  [huckster](https://wordpress.org/support/users/huckster/)
 * (@huckster)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16009526)
 * Nooo that’s the problem , the mails are not being sent now 🙁
 *  [huckster](https://wordpress.org/support/users/huckster/)
 * (@huckster)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16011863)
 * Sorry! I’ve just checked – it sends the email OK!
 *  [Thomas Patrick Levy](https://wordpress.org/support/users/thomasplevy/)
 * (@thomasplevy)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16013799)
 * I’m just chiming in that I’m seeing this error on my server as well.
 * I’m on a managed WP host (Pagely) and they have what may be a bit of a non-traditional
   setup.
 * Mail *is* working on my server I just have the notice on the admin panel.
 * Current function path: /wordpress-versions/6.0.2/wp-includes/pluggable.php:182
 * Our actual site is a different path and WP core files are symlinked into the 
   site’s hosted directory.
 * The actual ABSPATH is like this: `/data/{server_id}/home/{user_name}/sites/{domain}`
 *  Plugin Author [Gregor Capuder](https://wordpress.org/support/users/capuderg/)
 * (@capuderg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16015409)
 * Hi [@thomasplevy](https://wordpress.org/support/users/thomasplevy/),
 * thank you for this information.
 * Our check expects the full path of the file and that’s why it’s showing up this
   admin notice.
 * So, it’s a false positive, just as for the user above (huckster). I would suggest
   hiding the admin notice with the code snippet mentioned [in this message](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16009452).
 * Thank you and have a nice day!
 *  [Thomas Patrick Levy](https://wordpress.org/support/users/thomasplevy/)
 * (@thomasplevy)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/2/#post-16035673)
 * [@capuderg](https://wordpress.org/support/users/capuderg/)
 * Noted and taken care of, thanks… But I would love to emphasize that the practice
   symlinking WP core files in this manner isn’t disallowed or frowned upon and 
   it’s common for managed WP hosts to do this to prevent users from breaking their
   own site…
 * I’m sure you’re working to try to help users know when they’ve accidentally broken
   their site by moving core files or overwriting this pluggable function (or when
   another plugin has done so) but… in my case (and I’m sure the case of other folks
   on managed hosts) we’re not doing anything wrong and what’s done is out of our
   control.
 * Just my unsolicited thoughts on the matter

Viewing 15 replies - 16 through 30 (of 31 total)

[←](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/?output_format=md)
[1](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/?output_format=md)
2 [3](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/3/?output_format=md)

The topic ‘incorrect “wp_mail” function location’ is closed to new replies.

 * ![](https://ps.w.org/wp-mail-smtp/assets/icon-256x256.png?rev=1755440)
 * [WP Mail SMTP by WPForms - The Most Popular SMTP and Email Log Plugin](https://wordpress.org/plugins/wp-mail-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mail-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mail-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mail-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mail-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mail-smtp/reviews/)

 * 31 replies
 * 11 participants
 * Last reply from: [Gregor Capuder](https://wordpress.org/support/users/capuderg/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/incorrect-wp_mail-function-location/page/3/#post-16037904)
 * Status: resolved