Jump to content

joshwah

New Members
  • Posts

    1
  • Joined

  • Last visited

joshwah's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a contact form that uses send-mail.php. I got it to work on one site and literally copied it to another site but it doesn't work. The error shows and the success message shows and it certainly doesn't send emails. ----------------------------------------------------------------- PHP Code ----------------------------------------------------------------- <?php //vars $subject = $_POST['subject']; $to = explode(',', $_POST['to'] ); $from = $_POST['email']; //data $msg = "NAME: " .$_POST['name'] ."<br>\n"; $msg .= "EMAIL: " .$_POST['email'] ."<br>\n"; $msg .= "COMMENTS: " .$_POST['comments'] ."<br>\n"; //Headers $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=UTF-8\r\n"; $headers .= "From: <".$from. ">" ; //send for each mail foreach($to as $mail){ mail($mail, $subject, $msg, $headers); } ?> ----------------------------------------------------------------- Form Code ----------------------------------------------------------------- <!-- form --> <script type="text/javascript" src="_/js/form-validation.js"></script> <form id="contactForm" action="#" method="post"> <fieldset> <p><input name="name" id="name" type="text" class="text" placeholder="Full Name" title="Enter your full name" /></p> <p><input name="email" id="email" type="text" class="text" placeholder="Email Address" title="Enter your email address" /></p> <p><textarea name="comments" id="comments" rows="5" cols="38" placeholder="Message" title="Enter your comments"></textarea></p> <!-- send mail configuration --> <input type="hidden" value="joshua.ward@me.com" name="to" id="to" /> <input type="hidden" value="Sioux Signs Inquiry" name="subject" id="subject" /> <input type="hidden" value="send-mail.php" name="sendMailUrl" id="sendMailUrl" /> <!-- ENDS send mail configuration --> <p><input type="button" value="Submit" name="submit" id="submit" class="submit" /> <span id="error" class="warning">Something went wrong. Please refresh your page and try again.</span></p> </fieldset> </form> <p id="sent-form-msg" class="success">Your message has been sent. We'll be in touch soon.</p> </div> <!-- ENDS form --> ----------------------------------------------------------------- This same form works on another site. I'm not sure why. Any suggestions?
×
×
  • 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.