This question already has an answer here:
- How do you make sure email you send programmatically is not automatically marked as spam? 21 answers
I am using codeigniter mail function. Its sends mail perfectly. But all the time mail going to the spam folder. How can I overcome this.
Function
function msg_now(){
$this->load->library('email');
$this->load->library('parser');
$config['protocol'] = 'sendmail';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$this->email->initialize($config);
$email_id='test@test.com';
$name=$this->'test';
$this->email->from('test@gmail.com');
$this->email->to($email_id);
$this->email->subject('Test subject');
$this->email->message("<p>Lorem ipsum dummy content</p>");
$this->email->send();
}