dongren1986 2016-09-22 10:17
浏览 112

将Bootstrap表单数据发送到电子邮件地址

I have a bootstrap form which I need to send to am email address once the contact form has been submitted. I've built the form using Bootstrap but I've not used PHP before and I'm not sure how to integrate this with the rest of the site.

Is there an alternative to PHP for simply and safely submitting this form data to the email address?

  <div class="row" id="contact_us_form">
  <h1>Ready to talk?</h1>
  <h4 style="margin-bottom:30px">Please call <a href="tel:+441248749bg5" id="telephone">0345897394852</a>, email <a href="mailto:email@email.com?Subject=Website%20Enquiry" target="_top" id="email">email@email.com</a> or fill out the contact form below for a FREE 15 minute consultation.</h4>
  <div class="col-sm-5 form-group">
    <input class="form-control" id="name" name="fname" placeholder="First Name" type="text" required>
    <input class="form-control" id="name" name="lname" placeholder="Last Name" type="text" required>
    <input class="form-control" id="email" name="email" placeholder="Email" type="email" required>
  </div>
  <div class="col-sm-7 form-group">
    <textarea class="form-control" id="comments" name="comments" placeholder="Message" rows="5"></textarea>
  </div>
  <div class="col-sm-12 form-group"><button class="btn btn-default pull-right" type="submit">Send</button></div>
</div>
  • 写回答

1条回答 默认 最新

  • douba3943 2016-09-22 10:30
    关注

    You could do it in a few steps. Or just one tutorial.

    You should first learn some more about how PHP form handling works. Start with this: http://www.w3schools.com/php/php_forms.asp (Dont forget the <form> tags around your form, as you currently do not have these)

    (You could do validation, as you want it safely send: http://www.w3schools.com/php/php_form_url_email.asp)

    Then move on to sending emails. As linked by @shubham: How to send an email using PHP?

    It is not that hard. There are many complete tutorials online. As a simple google search delivered this tutorial: http://www.html-form-guide.com/email-form/php-form-to-email.html

    Also be cautious when implementing a contact form. A contact form without captcha validation is prone to spam. Please consider implementing captcha. Hope this helps.

    评论

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探