title: Codeigniter PHPMailer how to get the address and mailcontent using inputfields?
body: <p>Good Day everyone who has an idea on how to get the message and add address using input fields.</p>
  <pre><code>public function send()
      {
          $this-&gt;load-&gt;library('phpmailer_lib');
          try
          {
              $mail=$this-&gt;phpmailer_lib-&gt;load();
              $mail-&gt;setFrom('rayjayabejuela@gmail.com','Rayjay');
              $mail-&gt;addAddress('flutterrun@gmail.com'); // I want the input data came from the input fields of email.
   
              $mail-&gt;Subject=&quot;Subject Matter&quot;; 
              $mailContent=''; I want the input data came from the input fields came from the message.
              $mail-&gt;Body=$mailContent;
              
              if($mail-&gt;send()){
                  echo &quot;Email has been set&quot;;
              }
          }
          catch(Exception $e){
              echo $mail-&gt;ErrorInfo;
          }
      }
  </code></pre>
  <p>This is my view page page</p>
  <pre><code>&lt;form action=&quot;&lt;?php echo base_url(); ?&gt;email/send&quot; method=&quot;post&quot;&gt;
     &lt;br&gt;
     &lt;input type=&quot;email&quot; name=&quot;email&quot; class=&quot;form-control&quot; placeholder=&quot;Enter Email&quot; required&gt;
     &lt;br&gt;
     &lt;textarea name=&quot;message&quot; class=&quot;form-control&quot; placeholder=&quot;Enter message here&quot; required&gt;&lt;/textarea&gt;
     &lt;br&gt;
     &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Send Message&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>