'Why by codeigniter email is going to spam folder with full information?

Hi i am using CodeIgniter with PHP technology and i am sending emails from application but emails are being sent in spam folder of recipients.

$this->load->library('email');

$config['protocol'] = 'sendmail';
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';

$this->email->initialize($config);

$this->email->from('[email protected]', 'MYRegistration');
$this->email->to('[email protected]');

$this->email->subject('Congratulation ! You are a User.');
$this->email->message('html code');
$KsbMailStatus = $this->email->send();

This email contains some images and links also because this is a registration emails.



Solution 1:[1]

Because of this line the email is filtered into the spam

   $this->email->subject('Congratulation ! You are a User.');

Change it to some things else

 $this->email->subject('hi thanks for the subscription.');

Solution 2:[2]

$this->email->from('[email protected]', 'MYRegistration');

The from email address '[email protected]' should exists.

Change it to a valid email address that is exists.

May resolve your problem

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 saurabh kamble
Solution 2 Swapnil T