I am developing an e-commerce system. My e-commerce system is up in my hosting called zoom. I am done in the part of ordering and right now, I'm having difficulty in sending the email.
It is working but it goes in the spam folder instead of inbox.
NOTE: I already created an email account in my hosting zoom and I used it in my code(you can see below)
Question: I want to send the email without being labeled as spam. Is there something missing or wrong in my code? Please point me towards right direction.
Controller
public function process()
{
$id = $this->session->userdata('id');
$where = array('id' => $id);
$get_orders = $this->Crud_model->join_orders_customer('*','orders',$id);
$get_invoice = $this->Crud_model->get_invoice('*','orders',$id);
$email = $this->Crud_model->get_email($id);
$config = array(
'smtp_timeout' => '4',
'charset' => 'utf-8',
'mailtype'=> 'html'
);
$this->load->initialize($config);
$fromemail="zeesdelivery@zessdelivery.com";
$to = $email->email_address;
$subject = "Your Order is not Processing";
foreach($get_orders as $row){
$mesg = "<h1>Schedule Accepted!!!</h1>
<h3>Thank you for trusting and using Exclure Pest Control. $row->product_name</h3>
<h3>Your reserve inspection is accepted. We sure to call you as soon as possible</h3>
<p>--------------------------------------------------------------------------------------</p>
<h4>For more details contact us at,</h4>
<h4>Exclure Pest Control</h4>
<h4>Email : exclure@exclure.com.ph</h4>
<h4>Contact Number: 525-5399/ 498-1626 </h4>
<h4>Facebook : https://web.facebook.com/ExclurePestControl/</h4>";
}
$this->load->library('email');
$this->email->clear();
$this->email->from($fromemail, 'Zees Delivery');
$this->email->to($to);
$this->email->set_header('Header1', 'Value1');
$this->email->set_newline("\n");
$this->email->subject($subject);
$this->email->message($mesg);
$this->email->set_mailtype('html');
$this->email->send();
$this->cart->destroy();
echo json_encode("success");
}