0

I'm trying to build a simple sign up form where a person enters their email and submits.

This input is then emailed to the owner of the site, I thought the code below would work however it isnt?

<form id="signup-form" method="post" action="mailto:email@server.co.uk">
    <input type="text" name="email" id="email" placeholder="Email Address">
    <input type="submit" value="Sign Up">
</form>
emotality
  • 12,795
  • 4
  • 39
  • 60
Dave
  • 121
  • 9
  • This is just [tag:html] - you need a script to actually send the mail and complete the detalis. The easiest way I know of is using [tag:php] but each to their own... Basically this just _shows_ the form, you need the code that actually tells the server what to do _after_ the person presses the "submit" button – SierraOscar Sep 01 '15 at 11:09

1 Answers1

0

You have only created the HTML file. HTML file never interacts with server. To send mail either you have to use Javascript of PHP.

PHP Code to send email:

    <?php
   $to      = 'nobody@example.com';
   $subject = 'the subject';
   $message = 'hello';
   $headers = 'From: webmaster@example.com' . "\r\n" .
   'Reply-To: webmaster@example.com' . "\r\n" .
     'X-Mailer: PHP/' . phpversion();

   mail($to, $subject, $message, $headers);
    ?>

Documentaion

Send Email Using Javascript

Community
  • 1
  • 1
Rahul
  • 5,594
  • 7
  • 38
  • 92