Welcome Guest, Not a member yet? Register   Sign In
Contact Form Failure
#1

(This post was last modified: 08-19-2015, 11:32 PM by jjalvi.)

Hi there, I have a codeignitor based web portal accessible via www.webuyback.com.au I have a problem with my Contact Us Page form. Even after filling in all the details and hitting submit, I am not receiving any emails. The contact us page is located at http://www.webuyback.com.au/front_controller/contact_us

The code from front_controller.php that goes with the form is :

public function contact_us()
{
$this->form_validation->set_rules('name', 'Name', 'trim|required|xss_clean');
               $this->form_validation->set_rules('email', 'Email', 'trim|required|min_length[3]|max_length[100]|valid_email');
               $this->form_validation->set_rules('message', 'Message', 'trim|required|xss_clean');
               
if ($this->form_validation->run() == FALSE) {
$this->load->view('frontend/header');
        $this->load->view('frontend/contact_us');
        $this->load->view('frontend/footer');
        }else{
        $name = $this->input->post('name');
        $from = "[email protected]";
        $subject = "Contact Inquiry by ".$name;
        //$message = $this->input->post('message');
        $message = "From email : ".$this->input->post('email')."<br>".$this->input->post('message');
        $headers = "From: " . $name . "<" . $from . ">" . "\r\n";
        $headers .= 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-Type: text/html; charset=ISO-8859-1' . "\r\n";
        $to = "[email protected]";
       
        if(mail($to, $subject, $message, $headers)){
        $this->session->set_flashdata('successful_msg_contact','Your message has been sent successfully');
       
        }
redirect($this->uri->uri_string());
        }
}

Also the code from contact_us.php is :

<?php if($this->session->flashdata('successful_msg_contact')): ?>
            <div class="alert alert-success">
            <?php echo $this->session->flashdata('successful_msg_contact') ?>
            </div>
          <?php endif; ?>
 
  <form action='<?php echo base_url() ?>front_controller/contact_us' method='POST'>
<label for='name'>Name*</label><input type='text' id="name" name="name">
<br>
<label for='email'>Email*</label><input type='text' id="email" name="email">
<br>
<label for='message'>Message*</label><textarea id='message' name='message'></textarea>
<br>
<input type='submit' value='Send' name='submit'>
  </form>
       </div>


Any help to sort it out will be much appreciated. I cannot get hold of my developer and this error is just causing me trouble.

Thanks in advance.
Reply


Messages In This Thread
Contact Form Failure - by jjalvi - 08-19-2015, 09:39 PM
RE: Contact Form Failure - by mwhitney - 08-20-2015, 07:09 AM
RE: Contact Form Failure - by jjalvi - 08-20-2015, 09:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB