有没有人知道如何使用formspree.io使电子邮件表单看起来整洁

时间:2018-03-01 12:26:57

标签: javascript html css forms email

我遇到formspree电子邮件回复问题... 我点击提交按钮后设法避免重定向到他们的网站。 看起来像这样



var message = "";

$("#sendMessage").on("click", function() {
  message = $("#contactform").serialize();
  $.ajax({
    url: "//formspree.io/example@gmail.com",
    method: "POST",
    data: {
      message: message
    },
    dataType: "json"
  });
  alert('Thanks for the email, we\'ll be in touch promptly.');
  return true;
});

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<form id="contactform" method="POST">
  <div class="form-group">
    <div class="input-group">
      <span class="input-group-addon">Name</span><br>
      <input name="NAME" type="text" name="name" class="form-control" required>
    </div>
    <div class="input-group">
      <span class="input-group-addon">Email</span><br>
      <input name="EMAIL" type="email" name="_replyto" class="form-control" required>
    </div>
    <div class="input-group">
      <span class="input-group-addon">Subject</span><br>
      <input name="SUBJECT" type="text" name="subject" class="form-control" required>
    </div>
    <div class="input-group">
      <span class="input-group-addon">Description</span><br>
      <textarea name="DESCRIPTION" name="description" class="form-control" rows="4" cols="60" required></textarea>
    </div>
    <input type="text" name="_gotcha" style="display:none" />
    <button id="sendMessage">Send</button>
  </div>
</form>
&#13;
&#13;
&#13;

但是当我的邮件到达电子邮件时.... 看起来像这样

  

NAME =约翰+ Doe的安培; EMAIL=johandoe@gmail.com& SUBJECT =有些+主题&安培; DESCRIPTION =有一些+ +文本

有人知道如何使电子邮件表单在到达时看起来整洁吗? 提前谢谢!

0 个答案:

没有答案