Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Submitting a form

    I am sorry, but this is probably a silly question for you guys. I have a form and don't know the code I need so that the contents are sent to an email address when the user presses 'submit' .

    Thanks in anticipation.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,303
    Thanks
    23
    Thanked 612 Times in 611 Posts
    Email Form - Simple Form to Email PHP Contact Form
    That uses PHP, but you could also use this:
    <form action="MAILTO:someone@example.com" method="post" enctype="text/plain">
    Now everyone can see where the form goes.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    New Coder
    Join Date
    Aug 2014
    Location
    Thessaloniki,Greece
    Posts
    40
    Thanks
    2
    Thanked 2 Times in 2 Posts
    You better, put a javascript to validate your forms data.
    After that, send an email with php mail, or with phpmailer class (of course better solution)

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,943
    Thanks
    79
    Thanked 4,424 Times in 4,389 Posts
    Quote Originally Posted by sunfighter View Post
    Email Form - Simple Form to Email PHP Contact Form
    That uses PHP, but you could also use this:
    <form action="MAILTO:someone@example.com" method="post" enctype="text/plain">
    Now everyone can see where the form goes.
    CAUTION! Not all users have their browser linked to a default email client. So MAILTO: won't work at all for them.

    And for those who do, some (most?) browsers will put up a big warning that the user is about to send email generated from a web page and is he/she sure that's a safe thing to do and you must click here if you really really want to do this.

    In short, MAILTO: is a terrible idea. Use a PHP or other server-side email program to do it.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •