You will have seen yesterday that my Almerimar Life site gave a very ‘interesting’ error message if you tried to view it:
The e-mail could not be sent.
Possible reason: your host may have disabled the mail() function…
Interesting in that I had never seen it before, and because I did have email enabled.
The background was that I was posting a picture to the site, when I noticed that I wanted to edit a few other posts, so I went ahead and edited them and tried to repost them – all in Mars Edit. I have done this before and never had any issues, but somehow or other yesterday was a problem.
I checked the WP Forum and although it was an unresolved error at least I wasn’t alone. Media Temple confirmed that it wasn’t an issue with them and that it must be a WordPress problem.
Talking to Tom this morning he concluded that the problem was with the Comments Relish Plugin, and with a little tweaking we got it fixed:
Well this is what I did (a bit of cheat and an ugly hack really to get the site going). I found the following code inside comment-relish.php at line 239
if (FALSE == mail($l_Author->comment_author_email, cr_format_email($l_RelishSubject, $l_Author), cr_format_email($l_RelishMessage, $l_Author), $l_Headers)) {
// Delete the emailed row
$wpdb->query(“DELETE FROM $l_TableName WHERE emailed_ID='” . (int)$l_EmailedID . “‘”);
// Error out
die(‘
‘ . __(‘The e-mail could not be sent.’) . “
\n” . __(‘Possible reason: your host may have disabled the mail() function…’) . ‘
‘);
}
// Add the email to the processed array
$l_Processed[] = $l_Author->comment_author_email;
}
and replace with
if (FALSE == mail($l_Author->comment_author_email, cr_format_email($l_RelishSubject, $l_Author), cr_format_email($l_RelishMessage, $l_Author), $l_Headers)) {
// Delete the emailed row
$wpdb->query(“DELETE FROM $l_TableName WHERE emailed_ID='” . (int)$l_EmailedID . “‘”);
// Error out
// die(‘
‘ . __(‘The e-mail could not be sent.’) . “
\n” . __(‘Possible reason: your host may have disabled the mail() function…’) . ‘
‘);
}
// Add the email to the processed array
$l_Processed[] = $l_Author->comment_author_email;
}
OR so I thought!!! One resolution I tried last night was to upgrade to WP2.2, which probably wasn’t the smartest but the guy at Media Temple said some people seemed to have had some luck with it. Anyway that didn’t fix it, but this morning after the above tweak, the upgrade completed and now the Sidebar Widget wont activate, so although the site looks ‘normal’, in wp-admin I can’t activate or access the Sidebars.
To complicate things further I upgraded this site to 2.2 this morning, and guess what? The Sidebar Widget wont activate, so as you can see at the moment the sidebar is a little messed up.
Now going to focus on getting the Sidebars working again.
I am having this problem, too. When I try sending an email through WordPress, I have no issues. But as soon as I activate the Comment Relish plugin; it fails everytime with this error. Were you able to fix it? Do you have any tips?
I really appreciate the help!
Thanks!
Adam
To be honest I am not sure I remember 🙂 I have had problems with the Sidebar Widget not working in anything above 2.1 several times, not least yesterday on a new site I am setting up so it is worth checking that out.
I think the error message I was getting was really a general type one, not specifically linked to the email.
Have you tried editing that code into your comment-relish.php? I also removed the original plugin and reinstalled it.
Hope that is some help. Let me know. If not I will see if I can recall anything else that may help
Hi Chris!
Thanks for the quick reply! I actually just found a solution to the problem 🙂 You were right, it actually didn’t have anything to do with a failure to send emails (even though that’s what the error message would have you believe!), but it happens when the script tries to insert an empty email address (such as those for pingbacks in the comments table) into it’s own wp_cr_comments table. Someone else has written up a fix (plus some query optimizations) which you can find here : http://patchlog.com/wordpress/more-optimization-for-comment-relish-plugin/
Thanks again!
Adam Tait
Think Simple. Be Decisive.
http://thinksimplenow.com