Captain825 Posted July 18, 2008 Share Posted July 18, 2008 Hi All, Well I did it this time! I agreed to create a website and I did; it turned out well...except that I have no idea how to get the information on the forms to be emailed to my email address. I looked at some tutorials on php but they confused me even more. Can anyone help me sort out the basic script I need to email the form? Thanks ??? Link to comment https://forums.phpfreaks.com/topic/115345-email-forms/ Share on other sites More sharing options...
kenrbnsn Posted July 18, 2008 Share Posted July 18, 2008 This is the easiest way to do that: <?php if (isset($_POST['submit'])) { $body = print_r($_POST,true); $to = '[email protected]'; $from = 'From: [email protected]'; $subject = 'Form filled in'; mail($to,$subject,$body,$from); } ?> <html> <head> <title>test form</title> </head> <body> <form action="" method="post"> all your form fields <input type="submit" name="submit" value="Send"> </form> </body> </html> Ken Link to comment https://forums.phpfreaks.com/topic/115345-email-forms/#findComment-593056 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.