我Formspree联系表格不发送电子邮件信息

我Formspree联系表格不发送电子邮件信息

问题描述:

我一直在我的网站上使用formspree。一切工作都很好,然后表单信息不发送电子邮件。当表单被发送出去时,我看到名称和消息,但电子邮件只是没有注册。我看着简码,并没有看到任何事情。有没有人在这里看到这个问题?我Formspree联系表格不发送电子邮件信息

我也有我的“我正在寻找报价”的措辞重叠我的复选框在大多数浏览器。我放了一个p并拿出来,但我认为这可能会弄乱代码。还有什么想法呢?

这里的HTML:

   <form role="form" id="formspree" method="post"> 

        <div class="form-group"> 
         <label class="sr-only" for="contact-name">Your Name</label> 
         <input type="text" name="name" placeholder="Your Name" class="contact-email form-control" id="contact-email"> 
        </div> 
        <input type="text" name="_gotcha" style="display:none"> 
        <div class="form-group"> 
         <label class="sr-only" for="contact-email">Email</label> 
         <input type="text" name="email" placeholder="Email" class="contact-email form-control" id="contact-email"> 
        </div> 
        <div class="form-group"> 
         <label class="sr-only" for="contact-message">Message</label> 
         <textarea name="message" placeholder="Message" class="contact-message form-control" id="contact-message" style="height: 168px;width:100%;"></textarea> 
        </div> 
        <div class="row"> 
         <div class="col-sm-6" style=" 
text-align: right; 
padding-right: 15px; 

          <div class="form-group"><label class="checkbox-inline"><input id="looking_for_quote" type="checkbox" value="quote">I'm Looking For A Quote</label> 
          </div> 
         </div> 
         <div class="col-sm-6"> 

          <button type="submit" class="btn btn-lg"> Send Message</button> 
         </div> 
        </div> 
       </form> 

这里是脚本:

$(document).ready(function() { 

    // process the form 
    $('form[method=post]').submit(function(event) { 
     var email = "[email protected]"; 
     if ($('#looking_for_quote').is(':checked')) { 
       email = "[email protected]"; 
     } 

     $.ajax({ 
      url: "https://formspree.io/" + email, 
      method: "POST", 
      data: { 
       message: $('textarea').val(), 
       from: $('input[name=name]').val(), 
       _reply: $('input[type=email]').val() 
      }, 
      dataType: "json", 
      success: function() { 
       alert("Thanks! We'll get back to you soon."); 
      } 
     }); 

     // stop the form from submitting the normal way and refreshing the page 
     event.preventDefault(); 
    }); 

}); 
+0

我想明白了..我改变了_reply:$('input [type = email]')。 val()给email:$('input [name = email]')。val() –

我想通了,我认为。我_reply改变:$( '输入[类型=电子邮件]' ).val()发送邮件:$('input [name = email]')。val()