neeep Posted January 12, 2010 Share Posted January 12, 2010 Can anyone direct me to a clear and exact tutorial which provides the code on how to build a form and then have the inputs sent to my email address? I know this is pretty basic, but I haven't used php before and I need to have this functionality on my site. Thanks. Neeep. Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/ Share on other sites More sharing options...
Zane Posted January 12, 2010 Share Posted January 12, 2010 http://www.tutorialized.com/view/tutorial/Send-email-using-the-PHP-mail-function/636 Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993566 Share on other sites More sharing options...
Genesis730 Posted January 12, 2010 Share Posted January 12, 2010 I thought of doing this before when I first stated my site, but found it MUCH easier and more convenient to just store it to a database =] Is there any reason you'd rather have it emailed than stored in a database? Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993568 Share on other sites More sharing options...
neeep Posted January 12, 2010 Author Share Posted January 12, 2010 My client wants the information that the users enter in the input form emailed to her you see. It is thus easy for her to access anytime the form is filled out. (also, I have never used databases. I code only in html, css and javascript, so I don't know the first thing about databases) Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993570 Share on other sites More sharing options...
Genesis730 Posted January 12, 2010 Share Posted January 12, 2010 Can you please paste your code within [ c o d e ] [ / c o d e ] (not spaced out) tags so I can see how it's set up? also do you have MSN or Yahoo?? might be easier to help you with instant responses =] Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993574 Share on other sites More sharing options...
neeep Posted January 12, 2010 Author Share Posted January 12, 2010 Zanus. That tutorial won't download. It doesn't initiate my download manager at all. Genesis. I don't have any code yet. That's why I'm asking for a link to a clear and exact tutorial on how to collect information from input forms through your email. Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993575 Share on other sites More sharing options...
Genesis730 Posted January 12, 2010 Share Posted January 12, 2010 This looks like a good place to start http://php.about.com/od/phpapplications/ss/form_mail.htm Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993580 Share on other sites More sharing options...
Zane Posted January 12, 2010 Share Posted January 12, 2010 You don't download a tutorial. You read them.. and follow along. Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993586 Share on other sites More sharing options...
neeep Posted January 12, 2010 Author Share Posted January 12, 2010 Zanus. In this case, the tutorial page said Download the file to your computer: Click here to get the file . And this is where the problem was. There was only a couple of lines of code on the page otherwise. Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993601 Share on other sites More sharing options...
neeep Posted January 12, 2010 Author Share Posted January 12, 2010 Genisis. So that tutorial you sent me there. Is it only one html file and one php file that I need in my directory on the server for it all to work?? Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993602 Share on other sites More sharing options...
Genesis730 Posted January 12, 2010 Share Posted January 12, 2010 Yes neeep, well you only actually HAVE to have one, but for how the tutorial set it up, yes... The HTML (with the form) to collect the data the user inputs... Then the PHP (server side) to handle and email the data =] good luck Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993611 Share on other sites More sharing options...
neeep Posted January 12, 2010 Author Share Posted January 12, 2010 That's excellent, Thanks very much Genesis. And thank you also Zanus. Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993615 Share on other sites More sharing options...
neeep Posted January 12, 2010 Author Share Posted January 12, 2010 HI Genesis. I just executed that tutorial. However, that is not what I was trying to do. I need the input information to be sent to my email address. ie. that which is entered in the input boxes. Is this what the tutorial is supposed to do or did I explain myself unclearly? Thanks. I have it hosted here . http://www.fishpondmedia.com/kenny That all works, but I needed the input infos to be sent to me. Any ideas on how I could make that work? Here is my php file. <?php $to = $_REQUEST['sendto'] ; $from = $_REQUEST['Email'] ; $name = $_REQUEST['Name'] ; $headers = "From: $from"; $subject = "Web Contact Data"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"list"} = "Mailing List"; $fields{"Message"} = "Message"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: niamh.omahony11@gmail.com"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usualy within 48 hours. If you have any more questions, please consult our website at www.oursite.com"; if($from == '') {print "You have not entered an email, please go back and try again";} else { if($name == '') {print "You have not entered a name, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) {header( "Location: http://www.fishpondmedia.com/kenny/thankyou.html" );} else {print "We encountered an error sending your mail, please notify niamh.omahony11@gmail.com"; } } } ?> here is my html file. <html><body><font face=Arial size=2> <form method="post" action="contact.php"> <table bgcolor=#ffffcc align=center> <tr><td colspan=2><strong>Contact us using this form:</strong></td></tr> <tr><td>Department:</td><td><select name="sendto"> <option value="niamh.omahony11@gmail.com">General</option> <option value="niamh.omahony11@gmail.com">Support</option> <option value="niamh.omahony11@gmail.com">Sales</option> </select></td></tr> <tr><td><font color=red>*</font> Name:</td><td><input size=25 name="Name"></td></tr> <tr><td><font color=red>*</font> Email:</td><td><input size=25 name="Email"></td></tr> <tr><td>Company:</td><td><input size=25 name="Company"></td></tr> <tr><td>Phone:</td><td><input size=25 name="Phone"></td></tr> <tr><td>Subscribe to<br> mailing list:</td><td><input type="radio" name="list" value="No"> No Thanks<br> <input type="radio" name="list" value="Yes" checked> Yes, keep me informed<br></td></tr> <tr><td colspan=2>Message:</td></tr> <tr><td colspan=2 align=center><textarea name="Message" rows=5 cols=35></textarea></td></tr> <tr><td colspan=2 align=center><input type=submit name="send" value="Submit"></td></tr> <tr><td colspan=2 align=center><small>A <font color=red>*</font> indicates a field is required</small></td></tr> </table> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993625 Share on other sites More sharing options...
Genesis730 Posted January 12, 2010 Share Posted January 12, 2010 Do you use Yahoo! IM or MSN IM? If so i can help you a lot more there... thanks Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993729 Share on other sites More sharing options...
neeep Posted January 12, 2010 Author Share Posted January 12, 2010 Hi Genesis. My yahoo id is neeepie Do you want to find me? What's yours? Quote Link to comment https://forums.phpfreaks.com/topic/188200-input-form-details-sent-to-an-email/#findComment-993780 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.