1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to make simple form who sends all data to my email ?

Discussion in 'Web Design' started by ferma231, Apr 12, 2012.

  1. ferma231

    ferma231 Elite Member

    Joined:
    Jul 14, 2011
    Messages:
    1,698
    Likes Received:
    3,508
    Location:
    Internet
    How to make simple registration form to send all data to my email ?

    I have difficulties

    I need to make form with email , phone, city and some comments and i want everything be sent to my email

    But i have problems with :
    Code:
    <form action="MAILTO:someone@example.com" method="post" enctype="text/plain">
    If i click submit button , it just open gmail.com what i dont want, i want people to submit all info , they click submit and i receive they data. what should i do ?

    Rep+ thanks Guaranted !

    Full code -

    Code:
    <html><body>
    
    
    <h3>Send e-mail to someone@example.com:</h3>
    
    
    <form action="MAILTO:someone@example.com" method="post" enctype="text/plain">
    Name:<br />
    <input type="text" name="name" value="your name" /><br />
    E-mail:<br />
    <input type="text" name="mail" value="your email" /><br />
    Comment:<br />
    <input type="text" name="comment" value="your comment" size="50" />
    <br /><br />
    <input type="submit" value="Send">
    <input type="reset" value="Reset">
    
    
    </form>
    </body>
    </html>
    
    
    
     
  2. kokoloko75

    kokoloko75 Elite Member

    Joined:
    Jan 1, 2011
    Messages:
    1,628
    Likes Received:
    1,936
    Occupation:
    Design director
    Location:
    Paris (France)
    You need to use a PHP script like :
    PHP:
    <?php
    //define the receiver of the email
    $to 'youraddress@example.com';
    //define the subject of the email
    $subject 'Test email'
    //define the message to be sent. Each line should be separated with \n
    $message "Hello World!\n\nThis is my first mail."
    //define the headers we want passed. Note that they are separated with \r\n
    $headers "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
    //send the email
    $mail_sent = @mail$to$subject$message$headers );
    //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" 
    echo $mail_sent "Mail sent" "Mail failed";
    ?>
    And your form will be like :
    HTML:
    <form action="send.php" method="post" enctype="text/plain">
    Beny
     
    • Thanks Thanks x 1
  3. ferma231

    ferma231 Elite Member

    Joined:
    Jul 14, 2011
    Messages:
    1,698
    Likes Received:
    3,508
    Location:
    Internet
    Thanks. Now i need to learn about php scripts :D
     
  4. ferma231

    ferma231 Elite Member

    Joined:
    Jul 14, 2011
    Messages:
    1,698
    Likes Received:
    3,508
    Location:
    Internet
    Thanks Beny, everything went fine and i tested and it worked THANK YOU !
     
  5. BluRoze

    BluRoze Registered Member

    Joined:
    Jun 15, 2011
    Messages:
    77
    Likes Received:
    13
    Location:
    USA
    For anyone who's scared of using php, or doesn't have the time to figure it out, there are wp plugins that do this too. These include Contact form 7, which has a very nice dynamic text extension that lets it do cool stuff; and Easy contact forms.
     
    • Thanks Thanks x 1
  6. ferma231

    ferma231 Elite Member

    Joined:
    Jul 14, 2011
    Messages:
    1,698
    Likes Received:
    3,508
    Location:
    Internet
    Okey will take a look at this :)

    Thanks
     
  7. SocialMedia10

    SocialMedia10 BANNED BANNED

    Joined:
    Apr 4, 2012
    Messages:
    142
    Likes Received:
    86
    For anyone else, and you too, Jot form is the easiest I've used. I can't post a link because I'm new but just Google "Jot form"