ns recently enforced a comment area on my website and also tried to obtain the email an alert to work. The doesn"t it seems to be ~ to desire to send email notifications when new comments space made.

Just to see if PHP have the right to send emails, i tried to reset the password (because you"ll acquire a new password via mail), and also I got the message:

The e-mail can not be sent. Possible reason: your host may have actually disabled the mail() function

I"ve checked the checkboxes in setups -> Discussion, and the email is valid, for this reason it"s no a setting issue. I tried to develop a PHP document and send using mail(), and also it sent out successfully. So there have to be something weird going on v stayinfiji.com.

You are watching: The email could not be sent. possible reason: your host may have disabled the mail() function.

Any ideas?


php wp-mail email
share
boost this inquiry
follow
edited may 11 "19 at 20:25
*

butlerblog
4,22533 gold badges2222 silver badges3838 bronze badges
request Apr 8 "13 at 14:23
*

qwertyqwerty
62544 yellow badges1313 silver- badges2323 bronze title
1
include a comment |

10 answers 10


energetic oldest Votes
9
Step by step: very first find the paper where the error post appear. I use Notepad++ and also the CTRL + F command to find in files. It is a great idea to search just the first couple of words of the error message, due to the fact that some error messages are combined of various messages.

Your error message show up in wp-login.php and holy luck, just there. Therefore let"s have actually a look why this error could occur.

if ( $message && !wp_mail($user_email, $title, $message) )There are two conditions. $messagehave to it is in true (not an north string, no false, no null, etc). And wp_mail() shouldn"t return false.

One heat above, over there is a filter $message = apply_filters("retrieve_password_message", $message, $key);, so the is feasible that a plugin (or theme) use this filter and returns a value that is not true (empty string, false, null, etc.).

But that is much less complicated to examine if wp_mail() is functioning or not. Compose a small plugin to send a test mail to yourself:

(This is PHP5.3 code. If you room running PHP5.2, eliminate the namespace things)

The plugin should send a testmail automatically after activation. If not, calling part backend pages (e.g. Dashboard) should do it.

If the testmail does no arrive, then you probably have actually an problem with wp_mail(). So rotate on debugging:

define( "WP_DEBUG", true );define( "WP_DEBUG_LOG", true );define( "WP_DEBUG_DISPLAY", true );
ini_set( "display_errors",1 );Put this code right into your wp-config.php and also retry sending out yourself a testmail. Now you should gain some error messages and also they additionally should it is in logged into wp-content/debug.log (The debug log in can thrive very big if there are an ext errors resulted in by plugins and/or themes).

At this point, friend got an excellent informations if wp_mail() fails and if so, why. If wp_mail() occupational correctly and the testmail arrived, go ago to top and also find the end why $message is no true.

See more: The Best 10 Currency Exchange Houston Airport, Foreign Currency Exchange In Houston Tx

If girlfriend have concerns with wp_mail(), so keep in mind the wp_mail() walk not use PHPs mail() function. Stayinfiji.com use a PHP class (PHPMailer). Probably you simply need a plugin to use SMTP rather of sendmail. Or the difficulty is situated at an additional place. Us don"t know. You have to investigate.