【问题标题】:Php Mail Going For spamPHP 邮件成为垃圾邮件
【发布时间】:2018-04-25 19:48:21
【问题描述】:
<?php if (isset ($_POST['submit'])&& ($_POST['submit']!='')){
      $to = 'manojpraharsha@gmail.com';
      $subject = 'Website Enquery Request';
      $email = $_POST['email'];
      $name = $_POST['name'];
      $headers = 'From: Timespaces <'.$to.'>' . "\r\n";
      $headers .= 'Reply-To: '.$name.' <'.$email.'> ' . "\r\n";
      $headers .= 'Return-Path:' .$to . "\r\n";
      $headers .= 'MIME-Version: 1.0' . "\r\n";
      $headers .= 'Content-Type: text/html; charset=ISO-8859-1' . "\r\n";
      $message .= '<html><body>';
      $message .= '<table rules="all" style="border-color:rgb(130,0,67);" cellpadding="10">';
      $message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . strip_tags($_POST['name']) . "</td></tr>";
      $message .= "<tr><td><strong>Email:</strong> </td><td>" . $email . "</td></tr>";
      $message .= "<tr><td><strong>Phone:</strong> </td><td>" . strip_tags($_POST['phone']) . "</td></tr>";
      $message .= "<tr><td><strong>Subject:</strong> </td><td>" . strip_tags($_POST['subject']) . "</td></tr>";
      $message .= "</table>";
      $message .= "</body></html>";
      mail($to, $subject, $message, $headers);
      }
      ?>

这里是否有任何错误,我尝试了所有可能性,但所有邮件都进入了我的垃圾邮件

【问题讨论】:

  • 我也使用了相同的代码,但同样的问题
  • 这个话题已经以不同的方式讨论过很多次了。请继续研究并告诉我们您尝试解决的所有方法以及您找到了哪些链接。
  • 是的,我已经研究了所有代码,并且我已经尝试了所有代码,包括您建议的链接中的代码,但同样的问题它只会成为垃圾邮件
  • gmail 中的错误信息是 'This message may not have sent by: $email' $email 是用户填写的详细信息

标签: php


【解决方案1】:

您可以将PHP MailerSMTP 身份验证一起使用,或者使用带有流行(在活动对话中)发件人电子邮件ID 的专用IP 发送

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-24
    • 1970-01-01
    • 1970-01-01
    • 2011-07-12
    • 2015-08-22
    相关资源
    最近更新 更多