2

I am sending an email to User after who subscribe to my website newsletter. But sometimes the subscription email going to SPAM folder. I am sharing the link of spam mail test result -- https://www.mail-tester.com/web-3339Sp Please check the result(analysis) of SPAM mail tester given above & tell me why my mails are going to SPAM

Here is my configuration to send mail through code-->

    $config = Array( 
'protocol' => 'smtp', 
'smtp_host' => 'mail.holaa.in', 
'smtp_port' => 25, 
'smtp_user' => 'noreply@holaa.in', 
'smtp_pass' => 'XXXXXXXXX', 
'mailtype' => 'html', 
'charset' => 'iso-8859-1' 
); 
$this->load->library('email', $config); 
$this->email->set_newline("\r\n"); 
$this->email->from('noreply@holaa.in'); 
$this->email->to($receiver); 
$this->email->subject($subject); 
$this->email->message($message); 
$ans = $this->email->send();

Thanks in advance

The developer
  • 194
  • 1
  • 3
  • 15

2 Answers2

2

Email server setup:

The biggest problems are because you are sending it out via a hastily setup mail server.

  1. Delivered to internal network by a host with no rDNS
  2. We check if the server you are sending from is authenticated
  3. You may want to publish a DNS record (A type) for the hostname server18.hosotingraja.in or use a different hostname in your mail software.
  4. Your message is not signed with DKIM

If you look at the list of issues the priority ones are smtp setup related. If you want I can list a few solutions(specifically to the smtp setup) that might help you with that but they will be dependent upon your isp actioning them; unlikely to happen.

Quickest solution is to not use that service. For transactional emails there are plenty of services(paid and free) that you can use; Mailgun is a personal favorite because it is api based so removes loads of hassle, a quick google will turn up lots more.

CodeIgniter email:

  1. Please remove the X_PRIORITY header

The spam test indicates that your sending out emails with a high priority, it should default to 3 but in this case it apparently is not.

$this->email->priority(3);

This will set your priority to 'Normal' and reduce your score by 1.56.

Ne Ma
  • 1,719
  • 13
  • 19
-1

If you are using smtp for sending mails, I request you to user php_mailer library for send emails. Your email which are being sent by this library will be in inbox. I am using it since last 2 years. You will find library for php_mailer from google or below link.

https://github.com/anshkatriya/php_mailer

I hope this will solve your issue. Thanks.

Ghanshyam Katriya
  • 1,071
  • 1
  • 11
  • 37
  • No thats not issue I think so. I am using inbuilt Codeigniter library.. – The developer Mar 28 '16 at 10:28
  • It is definitely not the issue. Switching libraries will decrease his score by 1.56(according to the spam test) but could also create even more problems. – Ne Ma Mar 28 '16 at 10:40