发送电子邮件和https问题

时间:2017-02-27 01:06:24

标签: php email https

早上好! 我有一个问题,我的网站使用https://协议。当我使用Gmail向客户发送电子邮件时,邮件总是进入垃圾邮件文件夹而不是收件箱。是什么导致这个问题?你能回答这个问题吗?在此之前表示感谢和敬意。

我的代码是:

        $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);

0 个答案:

没有答案