Hello everybody, For the past week I've been tearing my hair out with a Question and Answer script for Wordpress that simply won't send a notification email out to me whenever a question is asked. The script sends an email out to the asker when their question is answered but not an initial one to me. The notification feature of the script is make or break for me. There seems to be something wrong with the mail notification function. It works fine on first install but refuses to work afterwards. The script in action can be seen online http://www.r4e.org/test-blog/ask-me and the code is at this link here. (http://pastebin.ca/497396) This has been a common problem with this script for several weeks and the authors are unresponsive. Could someone have a quick glance over the code and see if they can spot any immediate errors. Alternatively perhaps you could prescribe another script with the above functionality. Best Wishes RF
Hi all, Yes, it would appear to be the following function with the script. The script is an open source script from sarah at ilovecode.com. Script function: function send_email() { global $wpdb; $settings = $wpdb->get_row("SELECT Email, PerPage FROM ".TABLE_AM_SETTINGS." LIMIT 1"); $subject = "Someone asked you a question!"; $from = "From: " . $settings->Email; $body = "A question is waiting for your moderation:\n\n"; $body .= "User: " . $_POST['username'] . "\n"; $body .= "Email: " . $_POST['email'] . "\n"; $body .= "URL: " . $_POST['url'] . "\n"; $body .= "Question: " . $_POST['question'] . "\n"; mail($settings->Email, $subject, $body, $from); }//send_email() PHP: Working this through logically, I've dumped the contents of the 4 tables that this plugin installs in my wordpress database (http://pastebin.ca/498099) and to the best of my knowledge all the variables are there. My email is correctly entered in the settings table, but it may not be being pulled correctly from the database. If you have a second, can you spot anything immediately obvious in the pastebin entry? Thanks once again terribly. :thumbsup: RF