Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,154,639 members, 7,823,815 topics. Date: Friday, 10 May 2024 at 03:53 PM |
Nairaland Forum / Nigil's Profile / Nigil's Posts
(1) (of 1 pages)
Programming / Auto Respond Message By Using Gmail Smtp For Form Submit by nigil: 12:41pm On Mar 09, 2009 |
Hi i am a newbie here, I own a website, In my contact page ( http://www.nigil.uuuq.com/Contact Me/ )there is fileds for submitting name, email, and comments from users. By using a php file i am storing these data in to a txt file in the server. what i want to do is to sent an auto respond message to these email id's when they gets submitted using my gmail smtp mail account. i am using a free host so i dont have any mailserver. Is it possible. if possilble please help me to do it. any help would be well appreciated. given below the code for the html page for submiting data. <form action="http://www.mysite.com/mailer.php?savedata=1" method="post"> Your Name: <input type="text" name="name"><br> Your Email : <input type="text" name="email"><br><br> Your Message:<br> <textarea name="message" rows="1" cols="1"></textarea><br> <input type="submit" name="submit" value="Submit"> </form> given below the code for the php page for storing data. <?php $savedata = $_REQUEST['savedata']; if ($savedata == 1){ $data = $_POST['name']; $data1 .= $_POST['email']; $data2 .= $_POST['message']; $file = "YOURDATAFILE.txt"; $fp = fopen($file, "a" or die("Couldn't open $file for writing!" fwrite($fp, "*************** \n" ); fwrite($fp," Name: $data \n" fwrite($fp," Email: $data1 \n" fwrite($fp," Message: $data2 \n" fwrite($fp, "*************** \n" ); fclose($fp); } header('Location: http://www.mysite.com/Thank You'); ?> Thanks in Advance, Nigil. http://www.nigil.uuuq.com |
(1) (of 1 pages)
(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. 12 |