0

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>

Edited by zobadof

2
Contributors
3
Replies
12
Views
3 Years
Discussion Span
Last Post by zobadof
0

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";

?>
0

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

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.