-3

Hello and the end of my website i have this form :

<section class="contact" id="contact">
    <h1>Contact</h1>
    <hr/>       

    <div class="content">

      <div class="form">

        <form action="#" method="post" enctype="text/plain">

        <input name="your-name" id="your-name" value="Numele Tau" />
        <input name="your-email" id="your-email" value="Adresa de E-mail sau Telefon" />

        <textarea id="message" name="message" >Mesajul Tau</textarea>

        <a href="#">
          <div class="button">
            <span>SEND</span>
          </div>
        </a> 

        </form>

      </div>

What i an wondering is how can i make send email to a certain mail with all that info ?

Thanks, and sorry for my english,

  • 3
    As a starting point, you're going to need some server-side code. You tagged this with [tag:php] but didn't provide any PHP code. Questions seeking debugging help ("**why isn't this code working?**") must include the desired behavior, a *specific problem or error* and *the shortest code necessary* to reproduce it **in the question itself**. Questions without **a clear problem statement** are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example.](http://stackoverflow.com/help/mcve) – elixenide Jan 28 '16 at 22:38

1 Answers1

1

Create a seperate PHP file named for example sendmail.php. Change the opening <form> tag to the following:

<form action="sendmail.php" method="post">

Here is some basis code for sendmail.php:

<?php
    $message = $_POST['your-name'] . ' Sent the following message at ' . date('d-m-Y H:i') . '. Their email is ' . $_POST['your-email'] . '. ' . $_POST['message'];
    mail('adminemail@site.com', 'New contact form', $message);
?>
James
  • 1,088
  • 3
  • 11
  • 29