title: send form data to admin email in codeIgniter
body: <p>I am newer for codeigniter. I have an one contact form with fields of stream, name, email, contact. But I have an problem with form data are not send to admin email. When i tried to submit the data on contact form page source will alert but i have given other alert data.
  I have tried following code,</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#interiorid').submit(function (e) {
          e.preventDefault();
         var interiorstream = $('#interiorstream').val();
          var interiorname = $('#interiorname').val();
           var interiormobile = $('#interiormobile').val();
          var interioremail = $('#interioremail').val();
          var mobileVarify = /[0-9]/.test(interiormobile);
          var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  
  var dataString = 'interiorstream =' +  interiorstream + '&amp;interiorname =' + interiorname + '&amp;interiormobile =' + interiormobile + '&amp;interioremail =' + interioremail;
   
  
  alert(interiorstream);        
  if (interiorstream == "0") {
              alert('Please select Stream');
          }
          else {
              if (interiorname.length &gt; 2) {
                  if (mobileVarify == true &amp;&amp; interiormobile.length == 10) {
                      if (regex.test(interioremail) == true) {
                          $.ajax({
                               url: 'interior_email',
                              type: 'post',
                             data: dataString,
                              success: function (msg, status) {
    alert(status);
    alert(msg);
                                  $("#interiorid")[0].reset();
                                  window.location.href = "/contact/thank-you";
                              }
                          });
                      }
                      else {
                          alert('Invalid Email');
                      }
                  }
                  else {
                      alert('Invalid Number');
                  }
              }
              else {
                  alert('Please enter name');
              }
          }
      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!--- View ----&gt;
  &lt;form id="interiorid"&gt;
                                  &lt;div class="form-div"&gt;
                                      &lt;select value="" id="interiorstream" &gt;
                                          &lt;option value="0"&gt;Select a Stream&lt;/option&gt;
                                          &lt;option value="Interior Designing"&gt;Interior Designing&lt;/option&gt;
                                          &lt;option value="Fashion Designing"&gt;Fashion Designing&lt;/option&gt;
  
                                      &lt;/select&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-div"&gt;
                                      &lt;input type="text" placeholder="Name" id="interiorname"&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-div"&gt;
                                      &lt;input type="text" placeholder="Phone" id="interiormobile"&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-div"&gt;
                                      &lt;input type="text" placeholder="Email" id="interioremail"&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-div"&gt;
                                      &lt;input type="submit" value="submit"&gt;
                                  &lt;/div&gt;
                              &lt;/form&gt;
  
  &lt;!----Controller ----&gt;
  
  &lt;?php
  
  class Home extends CI_Controller {
  
      function __construct() {
          parent::__construct();
          $this-&gt;load-&gt;helper('url');
          $this-&gt;load-&gt;library('email');
          $this-&gt;load-&gt;helper(array('url'));
   
      }
  
      function index() {
  
          $this-&gt;load-&gt;view('templates/header');
          $this-&gt;load-&gt;view('home');
          $this-&gt;load-&gt;view('templates/footer');
          $this-&gt;load-&gt;helper('form'); 
           $this-&gt;load-&gt;view('interior/interior-intro'); 
      }
  
    
  
    
   function interior_email()
  {
    if (!isset($_POST['e-mail'])){
        //redirect if no parameter e-mail
        redirect(base_url());
      }else{
          $interiorstream = $this-&gt;input-&gt;post('interiorstream');
          $interiorname = $this-&gt;input-&gt;post('interiorname');
          $interiorphone = $this-&gt;input-&gt;post('interiorphone');
          $interioremail = $this-&gt;input-&gt;post('interioremail');
  
          $message = 'Hello Admin, This mail received from Interior design page contact form.&lt;br/&gt;&lt;br/&gt;
                  Stream:' . $interiorstream . '&lt;br/&gt;&lt;br/&gt;
                  Name :' . $interiorname . '&lt;br/&gt;&lt;br/&gt;
                  Contact :' . $interiorphone . '&lt;br&gt;&lt;br&gt;
    Email :' . $interioremail;
          
  
          $headers1 = "MIME-Version: 1.0\r\n";
          $headers1 .= "Content-type: text/html; charset=iso-8859-1\r\n";
          $headers1 .= "To:";
          $headers1 .= "example.com &lt;info@example.com&gt;";
          $headers1 .= "\r\n";
          $headers1 .= 'From: INIFD : info@example.com' . "\r\n";
          $headers1 .= "\r\n";
          $subject = "Enquiry From example.com Web";
          $email = 'admin@example.com';
         
          if (mail($email, $subject, $message, $headers1)) {
           echo 'mail has been sent';
              } else {
                  echo 'mail sending failed';
              }
   }
        }
  
  }
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>wrong popup like this:</p>
  
  <p><a href="https://i.stack.imgur.com/GsIif.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GsIif.png" alt="enter image description here"></a></p>
  
  <p>So please help me.</p>