Welcome Guest, Not a member yet? Register   Sign In
Email Help Error
#1

[eluser]razerone[/eluser]
Hi I have got my email just about working couple of errors

It sends to my email ok but doesn't get any data that client puts in.just sends a blank email.

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Contactus extends MX_Controller {

  function index() {

    $this->load->view('header');
    $this->load->view('contactus');
    $this->load->view('footer');

  }

  function mailsent() {

    $this->load->library('email');
    $this->email->set_newline("\r\n");
        
    $this->email->from($this->input->post('email'), $this->input->post('name'));
    $this->email->to('[email protected]');
    $this->email->subject($this->input->post('subject'));
    $this->email->message($this->input->post('message'));
  
    if($this->email->send()) {

      $this->load->view('header');
      $this->load->view('mailsent');
      $this->load->view('footer');
    }
    else {
      show_error($this->email->print_debugger());
    }
  }
}

<div class="container">
<div class="row">
&lt;form role="form" method="post" acti class="form-horizontal"&gt;
<div class="form-group">
&lt;input for="name" type="text" id="focusedInput" class="form-control required" id="name" placeholder="Enter Name"&gt;
</div>
<div class="form-group">
&lt;input for="email" id="focusedInput" type="text" class="form-control" id="email" placeholder="Enter Email"&gt;
</div>
<div class="form-group">
<select for="subject" id="focusedInput" class="form-control" id="subject" name="subject">
<option value="na" selected="">Choose One:</option>
<option value="service">Feedback</option>
<option value="suggestions">Suggestion</option>
<option value="support">Question</option>
<option value="other">Other</option>
</select>
</div>
<div class="form-group">
&lt;textarea for="message"  type="text" class="form-control" rows="4" placeholder="Message" name="message"&gt;&lt;/textarea>
</div>
<div class="pager">
<button type="submit" class="btn btn-primary">Submit</button>
<button type="reset" class="btn btn-danger">Reset</button>
</div>
&lt;/form&gt;
&lt;!-- output the results (Success or failure message from controller) --&gt;
<div id="results"></div>
</div>
</div>
#2

[eluser]razerone[/eluser]
I got it all working now by reading properly through user guide




Theme © iAndrew 2016 - Forum software by © MyBB