0

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);
  • Why don't you use EmailAPIs like MailJet,mailchimp or send authenticated emails using PHPMailer ? – Rishi Feb 27 '17 at 01:09
  • 1
    I agree witih Rishi, make the transition to PHPMailer, it is more trustworthy. Also, I think gmail is suspicious of 'newer' domains, and trust is increased after sufficient usage/time. – mickmackusa Feb 27 '17 at 01:13
  • Rishi, mickmackusa thanks a lot God bless you i will try – Chepy November Feb 27 '17 at 01:18
  • related: http://stackoverflow.com/questions/33691210/my-website-emails-are-going-to-spam-in-gmail – mickmackusa Feb 27 '17 at 01:22
  • Welcome to SO, Chepy, if you find an answer that no one else has discovered, please post it on PaulCrovella's suggested original question above. Since your question will not serve SO in the future, please delete it to keep SO lean and continue your research. – mickmackusa Feb 27 '17 at 01:25

0 Answers0