0

我有一个基本的电子邮件表格,我无法开始工作,它是从在线教程中获取的,由于某种原因,我无法将其发送到电子邮件地址。电子邮件表单注册所有字段都正确输出并显示发送的文本,但电子邮件似乎从未通过:

   <?php
 function spamcheck($field)
  {

  $field=filter_var($field, FILTER_SANITIZE_EMAIL);


  if(filter_var($field, FILTER_VALIDATE_EMAIL))
    {
    return TRUE;
    }
   else
    {
    return FALSE;
     }
  }
if (isset($_REQUEST['email']))

  {
   $mailcheck = spamcheck($_REQUEST['email']);
  if ($mailcheck==FALSE)
    {
    echo "Invalid input";
    }
  else{

  $fullname = $_REQUEST['fullname'] ;
  $email = $_REQUEST['email'] ;
  $link = $_REQUEST['link'] ;
  mail("myemail@me.co.uk", "Track link from: " .$fullname,
  $link, "From:" . $email);
  echo "Thank you for using our mail form";
    }
  }
else
  {

echo'<div id="formcontainer">
<form method="post" action="contact.php">
<div id="form">
    <div class="row">
    <div class="label">Your name</div><!--end .label -->
    <div class="input">
    <input type="text" id="fullname" class="detail" name="fullname" value="" />
    </div><!--end .input -->
    <div class="context">e.g Derek Datch</div><!-- end .context -->
    </div><!-- end .row -->

    <div class="row">
    <div class="label">Your email</div><!--end .label -->
    <div class="input">
    <input type="text" id="email" class="detail" name="email" value="" />
    </div><!--end .input -->
    <div class="context">We will not share your email with anyone.</div><!-- end .context -->
    </div><!-- end .row -->

    <div class="row">
    <div class="label">Link to track</div><!--end .label -->
    <div class="input">
    <input type="text" id="link" class="detail" name="link" value="" />
    </div><!--end .input -->
    <div class="context">e.g a link from Sound Cloud, Dropbox or any other files sharing website.</div><!-- end .context -->
    </div><!-- end .row -->

    <div id="sumbit">
    <input type="submit" id="submit" name="submit" value="Send link" />
    </div><!-- end #sumbit -->

</div><!-- end #form -->
</form>
</div><!-- end #formcontainer -->';
  }
?>
</body>
</html>
4

1 回答 1

0

我现在已经编辑了原始问题以显示工作代码。感谢您对此的所有帮助,我仍然不确定什么不起作用。我刚刚重新编写了代码,现在似乎可以工作了。我一定错过了什么,但就是看不到。

于 2013-11-13T22:00:52.860 回答