-1

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>
Pete Askew
  • 1
  • 1
  • 1

1 Answers1

-1

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.

Community
  • 1
  • 1
Fjarlaegur
  • 1,395
  • 1
  • 14
  • 33