-5

What is the easiest way to get this HTML contact form to send Emails?

<div class="col-lg-4">
    <h4>Hire Me</h4>
    <form role="form">
        <div class="form-group">
            <input type="name" class="form-control" placeholder="Your Name">
        </div>
        <div class="form-group">
            <input type="email" class="form-control" placeholder="Your Email">
        </div>                
        <textarea class="form-control" rows="3" placeholder="Tell me about your project..."></textarea>
        <br>
        <button type="submit" class="btn btn-success">SUBMIT</button>
    </form>             
</div><!-- /col-lg-4 -->
scrowler
  • 24,273
  • 9
  • 60
  • 92
Ch'an Armstrong
  • 57
  • 1
  • 1
  • 5

4 Answers4

2

As stated in this answer :

How to create an email form that can send email using html

You cannot do it directly via HTML. See the proposed answers.

Community
  • 1
  • 1
1

You will have to create a .php file with the php program to send the email..

you can refer to this website which will show how to do that and just call the php file you submit your form..

http://www.w3schools.com/php/php_mail.asp

Good luck! :)

valbu17
  • 4,034
  • 3
  • 30
  • 41
0

Add this to the form row

Then create a file called email-sending.php

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent=" From: $name \n Email: $email \n Order Number: $order_number \n Sign Up for Newsletter: $newsletter \n Message: $message";
$recipient = "your email";
$subject = "Subject from $name";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You! We will get back to you as soon as possible!" . " -" . "<a href='./index.php'> Back to site</a>";
?>
user2793640
  • 63
  • 1
  • 8
0

You can either use the PHP code in the answer above or you can use other programs out there that have been "battle-tested" already and are much safer to use.

A quick Google search gave PHPMailer from github: https://github.com/PHPMailer/PHPMailer

snake117
  • 3
  • 2