Hi,

Recently I downloaded a template which is awesome. However, it has a contact form on it but no way to set it up easily. I'm wondering how I can use the code provided in order to make it send to my email address. I'm aware this'll use PHP or something similar of which I have no idea how to use.

Any help would be much appreciated.

Contact Form

<form>
    <div class="row half">
      <div class="6u">
        <input type="text" class="text" name="name" placeholder="Name">
      </div>
      <div class="6u">
        <input type="text" class="text" name="email" placeholder="Email">
      </div>
    </div>
    <div class="row half">
      <div class="12u">
        <textarea name="message" placeholder="Message"></textarea>
      </div>
    </div>
    <div class="row">
      <div class="12u">
        <ul class="actions">
          <li><a href="#" class="button form">Send Message</a></li>
        </ul>
      </div>
    </div>
  </form>

what u have is just first part of code. User page.
Now you need handler page which will take input from about page and should send mail .

your page in html ( i have added mail handler php page in form tag and added button code in bottom)

<form action=mailhandler.php method=post>
    <div class="row half">
      <div class="6u">
        <input type="text" class="text" name="name" placeholder="Name">
      </div>
      <div class="6u">
        <input type="text" class="text" name="email" placeholder="Email">
      </div>
    </div>
    <div class="row half">
      <div class="12u">
        <textarea name="message" placeholder="Message"></textarea>
      </div>
    </div>
    <div class="row">
      <div class="12u">
        <ul class="actions">
          <li><input type=submit value='Send Message'></li>
        </ul>
      </div>
    </div>
  </form>

mailhandler.php (place in same folder as above file)

<?php

$retvalue=mail($_POST['email'], "subject: test mail", $_POST['message']);
if($retvalue)
    echo "mail sent";
else
    echo "problem occured, can not send mail";

?>

Hi,

After putting the code in and everything it changed the "Send Message" button and ideally I'd like to keep it as it is. You can see it here, chocants.co.uk/Home - Also, I was unsure on how to change where the emails are sent.

Thanks

If possible, I'd like it to change the "Any spam will be ignored and deleted." to "Your email has sent successfully" rather than making a new page for it.

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.