php - Cannot send mail with no "From" header Codeigniter -
i have library in codeigniter autoloads
<?php if ( ! defined('basepath')) exit('no direct script access allowed'); class send_email { private $ci; public $from_email; public $from_name; public $reply_to; public $to_email; public $subject; public $message; public function __construct() { $this->ci =& get_instance(); $this->ci->load->library('email'); } public function send_email($f_email,$f_name,$t_email,$rep_to,$sub,$msg){ $this->from_email = $f_email; $this->from_name = $f_name; $this->to_email = $t_email; $this->reply_to = $rep_to; $this->subject = $sub; $this->message = $msg; $this->ci->email->from($this->from_email, $this->from_name); $this->ci->email->to($this->to_email); $this->ci->email->reply_to($this->reply_to); $this->ci->email->subject($this->subject); $this->ci->email->message($this->message); $config['protocol'] = "smtp"; $config['smtp_host'] = "ssl://smtp.gmail.com"; $config['smtp_port'] = "465"; $config['smtp_user'] = "****@gmail.com"; $config['smtp_pass'] = "****"; $config['protocol'] = 'sendmail'; $config['mailpath'] = '/usr/sbin/sendmail'; $config['charset'] = 'iso-8859-1'; $config['wordwrap'] = true; $config['mailtype'] = 'html'; $this->ci->email->initialize($config); if($this->ci->email->send()){ return true; }else{ return $this->ci->email->print_debugger(); } } } ?>
and while calling controller
$this->send_email->send_email(......)
after calling method getting error cannot send mail no "from" header.how can solve problem?
check $this->from_email value coming or not
Comments
Post a Comment