Good Morning! I have a question, my website is using https:// protocol. When I send an email to client using Gmail, the mail always goes into the spam folder rather than the inbox. What causes this problem? Can you answer this question please. Thanks before and Best regards.
My code is :
$to = $_POST['email'];
$from = "pendaftaran@universitasbosowa.ac.id";
$subject = "Informasi PMB 2017 - 2018";
$headers = 'From: pendaftaran@universitasbosowa.ac.id (Panitia PMB Unibos 2017-2018)' . "\r\n";
$headers .= "Reply-To: ". strip_tags($email) . "\r\n";
$headers .= "CC: pendaftaran@universitasbosowa.ac.id\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$message = "<html><body style='font-family:calibri;'>";
$message .= "<img src='https://universitasbosowa.ac.id/logo-universitas-bosowa.png' alt='Universitas Bosowa' />";
$message .= "<h1>Terima Kasih ".$_POST['nama'].",</h1> <p style='font-size:16px;'>Selamat Anda telah melakukan sign up selanjutnya login ke <a href='https://universitasbosowa.ac.id/' target='_blank' style='text-decoration:none;'>Universitas Bosowa Admission</a> dengan memasukkan user Anda berikut ini</p>";
$message .= "<table cellpadding='10' cellspacing='0' style='border:5px solid #F4D03F; width:45%; word-wrap:break-word;'>";
$message .= "<tr style='background: #EF4836; color:white; font-size:16px;'><th colspan='2'><strong>User Login</strong> </th></tr>";
$message .= "<tr style='background: #2C3E50; color:white; font-family:calibri;'><td><strong>Username:</strong> </td><td><a style='color:white;'>".$_POST['email']."</a></td></tr>";
$message .= "<tr style='background: #5e738b; color:white; font-family:calibri;'><td><strong>Password:</strong> </td><td>".$_POST['password']."</td></tr>";
$message .= "<tr style='background: #2C3E50; color:white; font-family:calibri;'><td><strong>No. Handphone:</strong> </td><td>".$_POST['handphone']."</td></tr>";
$message .= "<tr style='background: #5e738b; color:white; font-family:calibri;'><td><strong>Waktu:</strong> </td><td>".$date."</td></tr>";
$message .= "</table><br/><br/>";
$message .= "<h3>Tertanda,</h3><br/><br/>Panitia PMB Unibos 2017-2018";
$message .= "</body></html>";
$ok = @mail($to, $subject, $message, $headers);