Php 发送垃圾邮件的邮件功能

Php mail function going to spam

我有一个免费的 000webhost 帐户,所以我不能使用 php 邮件程序或类似的东西。通常,每当我使用 php 邮件功能时,它都会转到我的垃圾邮件,但现在电子邮件甚至没有出现在任何地方(我假设 000webhost 的邮件服务器暂时关闭)。我希望能够拥有它,这样电子邮件就不会变成垃圾邮件。提前感谢您的帮助。

确保您有正确的 header 信息,但接收服务器会选择将电子邮件放在哪里。示例:gmail.com 认为您的 url/服务器/电子邮件是垃圾邮件。

这可能有很多原因,请确保您在 https://www.google.com/webmasters/tools/home?hl=en

上做了所有适当的网站管理员工作

这至少对 gmail 有帮助。

你只能这样做,连 Whosebug 的邮件都进入了我的垃圾邮件文件夹,堆栈很大。

请务必告诉提交表单的人检查他们的垃圾邮件文件夹。

  <?php
            $to = 'johndoe@gmail.com';        
      $from = "emailaccount_youhave_setupon_server@yoruserver.com";
      $subject = 'Website: Account Activation';
      $message = '<!DOCTYPE html><html>
             <head><meta charset="UTF-8"><title>Website: Message</title></head>
           <body style="margin:0px;">
               <div style="padding:10px;">
                Website: Account Activation
               </div>
            <div style="padding:24px; font-size:17px;">
             Hello '.$u.',<br><br>
             Click the link below to activate your account:<br><br>
             Click here to activate your account
         </div>
           </body></html>';
      $headers = "From: ".$from."\n";
      $headers .= "MIME-Version: 1.0\n";
      $headers .= "Content-type: text/html; charset=iso-8859-1\n";
      if(mail($to, $subject, $message, $headers)){echo 'email sent';}
    ?>