cakephp - Emails are going in spam in cake php -
here code:-
//sending mail if ($this->session->read('enrollment.personalinfo_language') == 'english') { $language = "english"; $subject = "thank submitting enrollment request apna energy."; } else { $language = "spanish"; $subject = "gracias por enviar su solicitud de inscripci?n apna energy."; } $details = $this->session->read('enrollment'); $details['plan_name'] = $product['product']['name']; $details['rate'] = $plan_rate; $details['term'] = $product['term']['term']; $this->email->sendas = 'html'; $this->email->from = 'apna energy <contact@apnaenergy.com>'; $this->email->to = $this->session->read('enrollment.personalinfo_first_name') . ' ' . $this->session->read('enrollment.personalinfo_last_name') . '<' . $this->session->read('enrollment.personalinfo_email') . '>'; $this->email->bcc = array('my@mail.com'); $this->email->subject = $subject; $this->set('details', $details); if ($this->session->read('enrollment.personalinfo_language') == 'english') { $template = "enrollment_confirmation"; } else { $template = "enrollment_confirmation"; } $this->email->template = $template; $this->email->send(); my problem if customer fill form receiving mail in his/her spam folder.. customer's mail id in "to".. , mail id in "bcc" me mail coming fine in inbox folder..
i followed 2 url didn't work out me..
how make sure email send programmatically not automatically marked spam?
guide me in right direction.. thanks!!
by using smtp
with normal php server must configured not easy beginner (mx records need match servers ip etc). stick smtp mailing gateway , fine.
ps: don't think has code in general, although not beautiful. instance: should cast array read session avoid notices thrown:
$details = (array)$this->session->read('enrollment');
Comments
Post a Comment