darpaia22 Posted January 4, 2020 Share Posted January 4, 2020 I created a contact form utilizing w3schools code but need help figuring out how to make the submit button send the form's information to an email. Below is the code: <meta name="viewport" content="width=device-width, initial-scale=1"> <style type="text/css">body {font-family: Arial, Helvetica, sans-serif;} * {box-sizing: border-box;} input[type=text], select, textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; margin-top: 6px; margin-bottom: 16px; resize: vertical; } input[type=submit] { background-color: #4CAF50; color: white; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; } input[type=submit]:hover { background-color: #45a049; } .container { border-radius: 5px; background-color: #f2f2f2; padding: 20px; } </style> <div class="container"> <form action="/action_page.php"><label for="fname">First & Last Name</label> <input id="fname" name="firstname" placeholder="Your name.." type="text" /><label for="lname">Email</label> <input id="lname" name="lastname" placeholder="john@example.com" type="text" /><label for="info">Marketplace</label> <select id="info" name="info"><option value="—">Please Select</option><option value="Yes">Yes</option><option value="No">No</option></select><label for="info">Leading a Breakout</label> <select id="info" name="info"><option value="—">Please Select</option><option value="Yes">Yes</option><option value="No">No</option></select><label for="info">Volunteering</label> <select id="info" name="info"><option value="—">Please Select</option><option value="Yes">Yes</option><option value="No">No</option></select><label for="info">Other</label><textarea id="subject" name="subject" placeholder="Write something.." style="height:100px"></textarea><input type="submit" value="Submit" /> </form> </div> Link to comment Share on other sites More sharing options...
Funce Posted January 8, 2020 Share Posted January 8, 2020 If you want to send an email based on form submission, then you'll need to use a server-side programming language. Try the PHP tutorial, and proceed onto PHP Forms for Form Handling. Then check out the mail() function after that. You can take a look at other server side languages but PHP is my bias. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now