The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Contact form not working

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #173077

    It used to work fine but now it only works half the time. My contact form for some reason doesn’t send the email sometimes, and sometimes it does. I have no idea whats wrong with the code.

    yes i used the correct email,
    yes i checked my spam,
    yes i used a host

                                    <form action="index.php" method="POST">
                                        <div>&lt;h4&gt;Full Name&lt;/h4&gt;&lt;input type="text" name="name" /&gt;</div>
                                        <div>&lt;h4&gt;E-Mail Address&lt;/h4&gt;&lt;input type="text" name="email" style="border-left:solid 1px black; border-left:solid 1px #3dd97f; z-index:1;" /&gt;</div>
                                        &lt;h4 id="message-l"&gt;Message&lt;/h4&gt;&lt;textarea name="message"&gt;&lt;/textarea&gt;
                                        &lt;input type="submit" name="submit" value="Send E-mail"/&gt;
                                            if (isset($_POST['submit'])) {
                                                $field_name = $_POST['name'];
                                                $field_email = $_POST['email'];
                                                $field_message = $_POST['message'];
                                                $mail_to = '[email protected]';
                                                $subject = ' Message from '.$field_name;
                                                $body_message = 'From: '.$field_name."\n";//from entered name on contact form
                                                $body_message .= 'E-mail: '.$field_email."\n";//email entered on contact form
                                                $body_message .= 'Message: '.$field_message;
                                                $headers = 'From: '.$field_email."\r\n";
                                                $headers .= 'Reply-To: '.$field_email."\r\n";
                                                $mail_status = mail($mail_to, $subject, $body_message, $headers);

    If it’s sometimes not working, and it used to always work, something changed somewhere.

    Do you have access to the error logs?

    Does the site work locally?

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.