Welcome Guest, Not a member yet? Register   Sign In
sending email with unknown values
#1

I'm using the email library. When I try to send the values through my form, they do not arrive and do not send the mail because it has no address to send it , can someone help me with this


this is my code:

PHP Code:
public function send_post()
 
   {
 
     //configuracion para gmail
 
     $Name $this->input->post('Name');
 
     $Email  $this->input->post('Email');
 
     $Company  $this->input->post('Company');
 
     $Host $this->input->post('Host');
 
     $fo $this->input->post('fo');
 
     $cc $this->input->post('cc');

 
     $datestring  date('M d Y');
 
     date_default_timezone_set("US/Central");
 
     $time date("h:i a");

 
     $config = array(
 
     'protocol' => 'smtp',
 
     'smtp_host' => 'ssl://smtp.gmail.com',
 
     'smtp_port' => 465,
 
     'mailtype' => 'html',
 
     'smtp_user' => '***********.com',
 
     'smtp_pass' => '*********',
 
     'newline' => "\r\n",
 
    );

 
     //Load email library
 
     $data = array(

 
       'Name'=> $Name,
 
       'Email' => $Email,
 
       'Company' => $Company,
 
       'Host' => $Host,
 
       'Date' => $datestring,
 
       'Time' => $time
          
);

 
     $this->load->library('email',$config);
 
     $this->email->set_newline("\r\n");

 
     $this->email->from('****************''Foreigner');
 
     $this->email->to($fo);
 
     $this->email->cc($cc);
 
     $this->email->subject('Foreigner Visitor System');
 
     $body $this->load->view('email',$data,TRUE);
 
     $this->email->message($body);
 
     $this->email->set_mailtype('html');


 
    if($this->email->send()){
 
      echo "Email was sent successfully";
 
      return true;
 
    }else{
 
      echo "Error, it was not possible to send the email";
 
      $this->email->print_debugger();
 
    }
 } 
Reply


Messages In This Thread
sending email with unknown values - by arugama - 01-05-2018, 06:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB