Hi everyone" I need help configuring a contact from from a template I downloads, where should I add my email address , I've tried a lot of things , but when I click the submit button "outlook Express " opens in my screen, I dont want that , please help me, here is the code anyway. Thanks! <form action=""> <p> <label>Nombre</label> <input name="dname" type="text" size="35" /> <label>Email</label> <input name="demail" type="text" size="35" /> <label>Preguntas y comentarios </label> <textarea name="textarea" cols="5" rows="5"></textarea> <br /> <input type="submit" class="button" value="." /> </p> </form>
You should use PHP to send the contact us form via email. This would require some additional code from what you have there. I could do it for $10.00 via Paypal.
<?php if (isset($_POST['submit'])) { $to = "me@localhost"; // change this to the recipient's email address $headers = "From: Site Visitor\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $subj = "Inquiry"; $details = "Name: ".$_POST['contact']."\n"; $details .= "Email: ".$_POST['email']."\n"; $details .= "Message:\n".$_POST['message']; mail($to, $subj, $details, $headers); header("Location: thankyou.html"); // create a thankyou.html page in the same folder exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Inquiry Form</title> <script type="text/javascript"> function validate(nForm){ for (i=0; i<3; i++) {if (nForm[i].value == ""){alert('Please complete all fields');return false}} } </script> <style type="text/css"> form {width:300px;margin:auto;padding-top:30px} fieldset {padding:5px;background-color:#f0fff0;border:1px solid #87ceeb} legend {font-size:14pt;color:#00008b;background-color:#87ceeb;padding-left:3px;padding-right:3px;margin-bottom:5px;} label {font-size:12pt;color:#00008B;padding:5px} .submitBtn {font-family:tahoma;font-size:10pt;display:block;margin-left:auto;margin-right:auto;margin-top:5px;margin-bottom:5px} </style> </head> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" onsubmit="return validate(this)"> <fieldset> <legend>Inquiry</legend> <label> Name: <input type='text' name='contact' size='30'></label> <br> <label>Email: <input type='text' name='email' size='30'></label> <br> <label>Message: <br> <textarea name='message' rows='4' cols='30' style='overflow:auto;margin-left:12px'></textarea> </label> <input type='submit' name="submit" value="Submit" class="submitBtn"> </fieldset> </form> </body> </html> Code (markup):