Jump to content

beanpole136

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by beanpole136

  1. It turns out it was a server problem. Thanks for the coding help, Beanpole136
  2. Thank you for all of the help, but I am beginning to suspect this is a problem with server access. I am going to contact my hosting provider and see if they can figure it out on their end. Beanpole 136
  3. The function, even with the from header, returns 'Mailer did not accept mail.'
  4. I think there is some problem with my server and the mail function: I created a new php page to test the mail function again. <?php mail('MY EMAIL', 'subject', 'msg'); if (mail('MY EMAIL', 'subject', 'msg')) { echo "Mailer accepted mail."; } else { echo "Mailer did not accept mail."; } ?> This returns 'Mailer did not accept mail.'
  5. Ken2k7: Yes, previously I have been able to successfully send mail from my site. When I tried his code, I did indeed change $to to $to_email. I tried the variation you suggested, but that still returned a 'Mailer did not accept mail.' mikr: I tried the code you gave me, too. It also returned 'Mailer did not accept mail.'
  6. When I put in the code you gave me, the return was 'Mailer did not accept mail.' What should I do now?
  7. Well, I tried the form with just the email; it still didn't work. I am editing the site in Windows, but the server is Linux. Yes, the variables are properly filled out outside of the discussion. How would I go about checking if the mail function returned true or false? Thanks, Beanpole136
  8. I recently began to have problems with spambots using the forms on my website to send large amounts of spam. I took the forms off for now, and am trying to use Recaptcha to make them secure. The code I have written seems to be fine, and when the form is submitted, it returns a successful message. The only problem is that I never receive the email. My code is split into two pages, as follow: The form code for survey.php: <form method="post" name="send" action="surveym.php"> <input type="hidden" name="action" value="send" /> <span style="color:#997867"><strong>How did you find out about the Troop website?</strong></span><br /> <input type="radio" name="how" value="troopmeeting" /> When it was announced at a Troop meeting<br /> <input type="radio" name="how" value="anotherperson" /> From another Troop member<br /> <input type="radio" name="how" value="google" /> By searching Google<br /> <input type="radio" name="how" value="other" /> Other: <input type="text" name="other" id="other" size="20" /><br /><br /> <span style="color:#997867"><strong>So far, what do you think about the site?</strong></span><br /> <textarea rows="6" name="thinkabout" cols="40"></textarea><br /><br /> <span style="color:#997867"><strong>In your opinion, where does the site need improvement?</strong</span><br /> <textarea rows="6" name="improvement" cols="40"></textarea><br /><br /> <span style="color:#997867"><strong>The site is working on the development of the following features. Please select three options as ones you would look forward to the most</strong></span><br /> <input type="checkbox" name="new1" value="pictures" /> Pictures from Troop events<br /> <input type="checkbox" name="new2" value="gearreview" /> Gear review section<br /> <input type="checkbox" name="new3" value="games" /> Interactive games<br /> <input type="checkbox" name="new4" value="contactinfo" /> Contact information (password protected)<br /> <input type="checkbox" name="new5" value="redesign" /> A site redesign bringing in new colors and more room for information<br /> <input type="checkbox" name="new6" value="other" /> Other: <input type="text" name="other2" size="20" /><br /><br /> <?php require_once('recaptchalib.php'); $publickey = "MY KEY IS HERE"; echo recaptcha_get_html($publickey); ?> <br /> <input type="submit" name="submit" value="Submit" /><br /><br /> </form> The code in surveym.php: <?php require_once('recaptchalib.php'); $privatekey = "MY KEY IS HERE"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($_POST["submit"]) { if (!$resp->is_valid) { die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } else { $to_name = "ME"; $to_email = "MY EMAIL"; $subject = "Troop Survey"; $how_find = $_POST['how']; $other_find = $_POST['other']; $think_about = $_POST['thinkabout']; $n_improvement = $_POST['improvement']; $fav_feat1 = $_POST['new1']; $fav_feat2 = $_POST['new2']; $fav_feat3 = $_POST['new3']; $fav_feat4 = $_POST['new4']; $fav_feat5 = $_POST['new5']; $fav_feat6 = $_POST['new6']; $other_feat = $_POST['other2']; $body = "How person found site: $how_find\n Other: $other_find\n What person thinks about site:\n $think_about\n What person thinks needs improvement:\n $n_improvement\n Person's favorite features: $fav_feat1, $fav_feat2, $fav_feat3, $fav_feat4, $fav_feat5, $fav_feat6\n Other: $other_feat"; mail("$to_name<$to_email>", $subject, $body); print "<h2>Thank you for participating! Click the back button in your browser to return to the survey page.</h2>"; } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.