Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,196,460 members, 7,961,423 topics. Date: Sunday, 29 September 2024 at 03:37 AM |
Nairaland Forum / Science/Technology / Programming / Php Form To Mail (1660 Views)
Connecting Vb.net 2010 window Form To Sql Server Online / How Do I Connect A Form To Mysql Database / Php Form To Mail Problem (2) (3) (4)
Php Form To Mail by jozzy: 1:58pm On Feb 05, 2007 |
Can any one help me out how can i get php form to email script |
Re: Php Form To Mail by kengimel(m): 11:00am On Feb 06, 2007 |
Well i think this will help you http://formtoemail.com/ |
Re: Php Form To Mail by jozzy: 11:43am On Feb 06, 2007 |
Thank for that, but there is one i see you just put your feed back link, thank link and error link you send then it give you the code if i could get something like that because the link you get me i not know how to use it if only you can put on |
Re: Php Form To Mail by alexis(m): 9:21pm On Feb 06, 2007 |
tell the fields you want to use so that I can guide you how to build one |
Re: Php Form To Mail by jozzy: 2:40am On Feb 07, 2007 |
Thank for your reply, this is my code from the form when my feedback page is tag[b] fback.php[/b], the confirmation page is tag feedthank.php, and the error page is tag error.php, why the mail i want to add is barsplusplus@yahoo.com so you can check the code below and put me through <form action="feedback.php" method="post" name="feedback" target="_self" id="form" > <br> <div style="position:absolute; text-align: left; left: 31px; top: 23px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #2A7FAA; font-size: 12px; width: 85px; height: 15px; font-weight: 400;">FIRST NAME : </div> <div style="position:absolute; text-align: left; left: 166px; top: 19px;"> <input type="text" size="30" name="name_first" ></div> <br> <div style="position:absolute; left: 30px; top: 51px; width: 87px; text-align: left; font-weight: 400; font-size: 12px; color: #2A7FAA;">LAST NAME:</div> <div style="position:absolute; text-align: left; left: 166px; top: 47px;"> <input type="text" size="30" name="name_last" ></div> <br> <div style="position:absolute; left: 30px; top: 77px; width: 70px; text-align: left; font-weight: 400; font-size: 12px; color: #2A7FAA;">CHAPTER:</div> <div style="position:absolute; text-align: left; left: 166px; top: 74px;"> <input type="text" size="30" name="_chapter" ></div> <br> <div style="position:absolute; text-align: left; left: 30px; top: 107px; font-weight: 400; font-size: 12px; color: #2A7FAA;">ZONE:</div> <div style="position:absolute; text-align: left; top: 102px; left: 166px;"> <select name="_zone" size="1" > <option value="n_central">NORTH-CENTRAL</option> <option value="n_east">NORTH-EAST</option> <option value="n_west">NORTH-WEST</option> <option value="s_east">SOUTH-EAST</option> <option value="s_south">SOUTH-SOUTH</option> <option value="s_west">SOUTH-WEST</option> <option value="select" selected>Please select</option> </select></div> <br> <div style="position:absolute; text-align: left; left: 30px; top: 137px; width: 120px; color: #2A7FAA; font-weight: 400; font-size: 12px;">E-MAIL ADDRESS:</div> <div style="position:absolute; text-align: left; top: 132px; left: 166px;"> <input type="text" name="_e-mail" size="30" ></div> <br> <div style="position:absolute; text-align: left; left: 30px; top: 165px; width: 107px; color: #2A7FAA; font-size: 12px; font-weight: 400;">PHONE NO.:</div> <div style="position:absolute; text-align: left; top: 161px; left: 166px;"> <input type="text" name="_phone" size="30" ></div> <br> <br> <div style="position:absolute; text-align: left; left: 30px; top: 228px; font-size: 12px; font-weight: 400; color: #2A7FAA;">COMMENT:</div> <div style="position:absolute; text-align: left; left: 166px; top: 216px;"> <textarea name="_comment" cols="35" rows="7" ></textarea></div> <br> <br> <br> <div style="position:absolute; top: 369px; left: 237px; text-align: left;"> <input type="submit" name="submit" value="SEND MESSAGE" /></div> </form> <div id="flash" style="position:absolute; left:158px; top:700px; width:682px; height:80px; z-index:5"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="675" height="75"> <param name="movie" value="anime/IF%2007.swf"> <param name="quality" value="high"> <embed src="anime/IF%2007.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="675" height="75"></embed> </object> </div> <div id="footer" style="position:absolute; left:158px; top:800px; width:673px; height:26px; z-index:6" class="text"> <div align="left"><a href="contacts.php" target="_self" onmouseover="window.status='Click to see our contact info'; return true;" onmouseout="window.status=''; return true;">Contact us</a> | <a href="fback.php" target="_self" onmouseover="window.status='Click to send feedback to us'; return true;" onmouseout="window.status=''; return true;">Feedback</a><br> © Copyright 2006 - 2007. Bar++ Initiative . All right reserved.</div> </div> </div> </body> </html> |
Re: Php Form To Mail by xanadu: 3:05am On Feb 10, 2007 |
Hi jozzy, Came across your post and thought I should contribute my twopence worth. I have written a little script that should do what you want - a page called fthank.php (which processes your form, sends the email, generates an error if necessary and displays a thank you/confirmation message if the post is successful). So instead of three pages as you stated in your post, you could use two (to be more efficient, you could actually do it all on one page, but lets leave it at this for now). I have tried to comment the script as much as possible to help you understand the steps. Feel free to post a reply if you do not understand any of the steps. Here's fback.php (your form) - note that I have amended the "action" in the form tag to point to 'fthank.php'. <form action="fthank.php" method="post" name="feedback" target="_self" id="form" > Now here's fthank.php - the processor/confirmation/error page: <? Any queries, do post a reply. |
Re: Php Form To Mail by jozzy: 5:06am On Feb 13, 2007 |
Hello xanadu, thank very much have try it but i still can get it because is not send all it dos it just care all i input in the form when i try it may be it will send to my mail box pls do put me through |
Re: Php Form To Mail by xanadu: 12:49pm On Feb 14, 2007 |
jozzy, i have tested the scripts, and can assure you they both work. howare you running them? All you have to do is copy the scripts as I have pasted them in the earlier post, and paste them in .php files. Then place them in the same directory on your server. What server are you running them on, anyway? |
Re: Php Form To Mail by iilenloa(m): 11:37am On Feb 23, 2007 |
Hi, before the php mail function can work, make sure you have an SMTP server installed on the server where the PHP server is. I mean there must be an SMTP (Simple Mail Transfer Protocol) server installed on the server. It is the SMTP server that recieves the request and sends the mail. If there is no SMTP server installed on the server, the mail won't be sent. There are ways to test if the SMTP server software is installed. here it is;
Run the above code and check the response. That will make you know if the server has an SMTP server. There are cases that the server might have SMTP server but the require authentication for them to send mails. However if there is an SMTP server installed, you are bound to get a positive response from the server. Thanks. Feel free to ask as many questions as you can. Mail me @ iilenloa@gmail.com, by phone 08085736614. |
Re: Php Form To Mail by DevDel(m): 5:51pm On Mar 12, 2007 |
Let's assume you know how to design your usual php form that can submit calling up any other php script, To send to email is as basic as using codes like these: <?php $to = $_POST["to"]; $from = $_POST["from"]; $subject = $_POST["subject"]; $message = $_POST["message"]; $headers = "From: " . $from . "\r\n"; $mailsent = mail($to, $subject, $message, $headers); if ($mailsent) { echo "Congrats! The following message has been sent: <br><br>"; echo "<b>To:</b> $to<br>"; echo "<b>From:</b> $from<br>"; echo "<b>Subject:</b> $subject<br>"; echo "<b>Message:</b><br>"; echo $message; } else { echo "There was an error, "; } ?> to,from,subject,message being field names from your form |
Re: Php Form To Mail by DevDel(m): 5:52pm On Mar 12, 2007 |
Let's assume you know how to design your usual php form that can submit calling up any other php script, To send to email is as basic as using codes like these: <?php $to = $_POST["to"]; $from = $_POST["from"]; $subject = $_POST["subject"]; $message = $_POST["message"]; $headers = "From: " . $from . "\r\n"; $mailsent = mail($to, $subject, $message, $headers); if ($mailsent) { echo "Congrats! The following message has been sent: <br><br>"; echo "<b>To:</b> $to<br>"; echo "<b>From:</b> $from<br>"; echo "<b>Subject:</b> $subject<br>"; echo "<b>Message:</b><br>"; echo $message; } else { echo "There was an error, "; } ?> to,from,subject,message being field names from your form |
Re: Php Form To Mail by jozzy: 11:53pm On Mar 15, 2007 |
I use linux host. thank you very mush |
Re: Php Form To Mail by oleku(m): 1:27pm On Mar 24, 2007 |
This is a modified version Posted by DevDel, The advantage is that it can support form with multiple fields, Name , Age, Address and send all to your email, but it has no verification or field data. If you want the version with verification of field data please let me know. <?php |
(1) (Reply)
What Is Software Testing / Mathematics/computer Science Graduate / Firebase For Android Development
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 71 |