I know this is repeated question but i have tried all of Stackoverflow solutions and other googled links. But got no solution.
My Code:
$this->load->library('email');
// $config['protocol'] = 'smtp';
// $config['smtp_host'] = 'ssl://smtp.gmail.com';
// $config['smtp_port'] = 465;
// $config['smtp_timeout'] = '7';
// $config['smtp_user'] = 'myemail@gmail.com';
// $config['smtp_pass'] = '*********';
$config['protocol'] = 'mail'; // mail, sendmail, or smtp
// $config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'utf-8'; // utf-8, iso-8859-1, etc
$config['newline'] = "\r\n"; // “\r\n” or “\n” or “\r”
$config['mailtype'] = 'html'; // text or html
$config['validation'] = TRUE; // TRUE or FALSE whether to validate email or not
$this->email->initialize($config);
$this->email->from('AutoMailer@MyWEb.com');
$this->email->to($email);
$this->email->subject($_POST['subject']);
$this->email->message($message);
$result = $this->email->send();
if ($result) {
$this->session->set_flashdata('message', 'Email Send Successfully!');
} else {
echo $this->email->print_debugger();exit;
}
$email is some valid email and $message is html message I want to use simple 'mail' protocol to send email. Mail Send successfully but in My email Inbox/Spam no email to found. This was good till 2.x version But from 3.x version i keeping having these problems. So, I tried used sendmail & smtp protocol solutions but that gives no help. Please anyone have good solution for this or any debugging tips.