-1

I'm using php mail library to send email. The mail is getting delivered in spam instead of inbox.I want it to be delivered in inbox only. Would you please help me out with same. Below is my code

$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['protocol'] = 'sendmail';
$this->email->initialize($config);  
$this->email->from('info@etechdata.in', 'ETechData');
$this->email->to('er.alfiyasiddiqui26@gmail.com');
$this->email->subject('Verification');
$this->email->message('Just for testing');
echo $this->email->send();
  • 1
    You can send a mail, but you can't avoid the mail server recognising it as SPAM. If that would be possible, all spammers would use this for filling our inboxes with their spamming messages :-) – Dominique Apr 25 '18 at 08:13
  • 3
    Possible duplicate of [sending email via php mail function goes to spam](https://stackoverflow.com/questions/18229279/sending-email-via-php-mail-function-goes-to-spam) – Ignacio Ara Apr 25 '18 at 08:14

1 Answers1

0

Please check

  1. SPF record on the sending domain. Is the SMTP server you are using allowed to send on behalf of your domain? You can use this tool to check: https://mxtoolbox.com/spf.aspx
  2. You can try sending one email to https://www.mail-tester.com/. It will tell you what is wrong with your email, and why its flagged as spam.
Emil
  • 147
  • 2
  • 9