tutwelve Posted May 27, 2006 Share Posted May 27, 2006 Hi all,I'm very much a PHP newbie, so please forgive my ignorance throughout the following post.WHAT I WANT TO DO:I want the contents of a rich online html form to be sent to my personal e-mail address. I've searched online for tutorials regarding this matter but only find scripts that process "simple contact" forms. If I have a form that has more fields than subject, email and message(e.g. address, phone number, etc...) how can I get the contents of such a form sent directly to my email address?Hopefully, I'm making myself clear....Thanks ahead of time any assistance you can offer.Sincerely,TuTwelve Quote Link to comment https://forums.phpfreaks.com/topic/10550-rich-form-submission-via-sendmail/ Share on other sites More sharing options...
Randy Posted May 28, 2006 Share Posted May 28, 2006 form.html[code]<HTML> <head> <title> Form </title> </head> <body> <form action="mail.php" method="POST"> <input name="name"> <br><input name="email"> <br><input name="phone"> <br><input type="submit" value="Send!"> </form> </body></HTML>[/code]mail.php[code]<?php $email = "your@email.adress"; $subject = "Contact Form"; $message = "Name: ".$_POST['name']; $message .= "\nEmail Adress: ".$_POST['email']; $message .= "\nTelephone: ".$_POST['phone']; $message = wordwrap($message, 70); mail($email, $subject, $message); echo("Thankyou for filling out the Form!");?>[/code]I hope this is what you wanted to do...the email would look like:Name: BobEmail Adress: Bob@hotmail.comTelephone: 0123 1234567 Quote Link to comment https://forums.phpfreaks.com/topic/10550-rich-form-submission-via-sendmail/#findComment-39792 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.