Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 498
Amar Banerjee Avatar asked Jun 17 '13 15:06

Amar Banerjee


People also ask

How do I stop spam emails in CodeIgniter?

There are many reasons for mail to go in spam, but easy solution for it is to set the headers of the mail before sending and giving it priority. Here's how to do that in CodeIgniter. The function is set_header() : $this->email->set_header($header, $value);

Why does my webmail go to spam?

Top webmail providers have stated that they look at how many emails are opened and how many are deleted as a factor in spam filtering decisions. So if you have low open rates or read rates, your emails are at higher risk of being flagged as spam. You need to do everything you can to increase engagement.

Where is email spam folder?

You can find your Gmail Spam folder in the left sidebar on desktop, or via the three lines menu on mobile. From the Spam folder, you can either delete individual messages or delete them in bulk, if desired. To stop messages from going to Spam you can either report it as not being spam or create a filter.


1 Answers

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 :

  • http://www.contactology.com/check_mqs.php
  • http://www.emailspamtest.com/
like image 112
MaxiWheat Avatar answered Oct 06 '22 00:10

MaxiWheat