Amar Banerjee
Amar Banerjee

Reputation: 5012

spam email by using email library in codeigniter

I am using CI library for email.

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

And my mail function is.

$this->email->clear();
$this->email->set_mailtype("html");
$this->email->to($user_info[0]['email'] );
$this->email->from('[email protected]');
$this->email->subject($data['news_letter_info'][0]['subject']);
$this->email->message($data['news_letter_info'][0]['template_body']);
$this->email->send();

All values are coming correctly and mail is also delivering. But it is ended up in spam folder in gmail. Can anyone have any idea why this mail is counted as spam. What are the reason for a mail to be spam.

Upvotes: 6

Views: 2029

Answers (1)

MaxiWheat
MaxiWheat

Reputation: 6261

There are really many reason that might explain why an email ends up in the spam folder of your favorite mail client (web based or not) :

  • your server is in an ip blacklist
  • your emails contain keywords that are triggering a spam filter
  • you're sending spam
  • your mail server is misconfigured and sending out emails that look like spam
  • you are sending emails containing only images
  • your server doesn't use DKIM and SPF to authenticate email (see this webmaster SE question)
  • Many other reasons I don't remember ;-)

Jeff Atwood also wrote a nice article on his blog about good practices for send email through code.

As for some places to check if your email looks like a spam here are two I've found :

Upvotes: 3

Related Questions