使用Formspree

时间:2018-08-05 22:28:20

标签: html forms email

我使用Formspree将信息从表单发送到我的电子邮件。点击提交按钮后,即使我的'action ='属性重定向到链接,我也会在控制台中收到404资源未找到(process.php)错误

<form action="https://formspree.io/myemail@gmail.com" id="contact-form" class="form-horizontal" role="form" method="POST">

              <input type="text" class="form-control" id="form-subject" name="form-subject" placeholder="Subiect" required>

              <textarea class="form-control" rows="6" id="form-message" name="form-message" placeholder="message" required></textarea>
                  <div class="text-center">
                      <button type="submit" class="battn">Submit</button>
                  </div>
</form>

我什至尝试在人体中添加Referrer作为元标记

<meta name="Referrer" content="origin">

2 个答案:

答案 0 :(得分:0)

只是发现出了什么问题!表单ID被process.php调用。更改了它的ID,现在可以正常使用

答案 1 :(得分:-1)

摘自this大礼包文章:

  
      
  • 您正在测试您的站点,方法是在浏览器中将其作为计算机文件系统中的静态HTML文件打开。在这种情况下,其URL不会以http://或https://开头。 这将不起作用,因为浏览器不会将这些页面视为普通的网络资源,因此,当您提交表单时,它们不会自动发送“ Referer”标头。 Formspree要求该标头起作用。如果仅从本地Web服务器将HTML文件作为Web资源打开,则可以解决此问题。如果您使用的是Mac或Linux,只需键入python -m SimpleHTTPServer 8000或HTML文件目录,然后在浏览器上访问http://localhost:8000。如果您使用的是Windows,请尝试安装以下超级简单的Web服务器之一:Web server for Chromethttpd或Quickshare。
  •   

紧随其后的一点是,您已经在本文中完成了操作(添加了'action =“ https://formspree.io/email@address.com”'

相关问题