Welcome Guest ( Log In | Register)



3 Pages V   1 2 3 >  
Reply to this topicStart new topic
> Php Emailer/contact System, An email or contact system for your site
maddog39
post Mar 7 2005, 11:28 PM
Post #1


Super Member
*********

Group: Members
Posts: 208
Joined: 27-January 05
From: LI, New York
Member No.: 3,448



Hello all,

Here is an easy Emailer or Contact system that allows visitors or members of your site to email you just by filling out a form. So here is what you need to do to set it up.
First open up a new page in your text editor and paste in the following code.
CODE

<?php
$Name = $_POST['Name'];
$Subject = $_POST['Subject'];
$Email = $_POST['Email'];
$Site = $_POST['Site']; $Message=$_POST['Message'];
$align = $_POST['align'];
$to = "$EmailTo";
$subject = "$Subject";
$body = "$Message\n\n\n$Site\nBy: $Name";
$headers = "From: $Email\n";
mail($to,$subject,$body,$headers);
// After they've clicked "Send", this is where they are going... Change it to where you want them to go.
header("Location: sent.htm");
?>

then save this file as mailform.php
Next open up another new page in your text editor and paste in the following code.
CODE

<form action="mailform.php" method="post">
<input type=hidden name=EmailTo value="You@mail.com"> <!-- // Change to your email address // -->
Your Name: <input type=text name=Name><br>
Subject: <input type=text name=Subject><br>
Your Email: <input type=text name=Email><br>
Your Site: <input type=text name=Site><br>
Message: <br><textarea name=Message rows=6 cols=30></textarea><br>
<input type=submit value="Send"> <input type=reset value="Reset"></form>

then save that page as contact.htm
For the the last page, open up a new page in your text editor and paste in this code.
CODE

<p>Your message has been sent to the webmaster. You should recieve a reply shortly. </p>
<p><a href="index.php" target="_self">Go Back To Index?</a></p>

and then save that page as sent.htm
Upload all of the files to your server and your done.

*Also note that you can just take the code from 'contact.htm' and put it in another of your webpages on your site and do whatever you want with it but dont do anything with the other files or code unless you really know what your doing.

Comments are always appreciated and enjoy! wink.gif biggrin.gif
Go to the top of the page
 
+Quote Post
Dooga
post Mar 8 2005, 12:56 AM
Post #2


Moderator
Group Icon

Group: [MODERATOR]
Posts: 1,327
Joined: 26-December 04
From: Canada
Member No.: 2,940



Couldn't we also use the CGI bin? That would seem easier for me smile.gif
Go to the top of the page
 
+Quote Post
millertime
post Mar 8 2005, 03:02 AM
Post #3


It's Miller Time
********

Group: Members
Posts: 164
Joined: 8-February 05
Member No.: 3,672



does this work for anybody or do you have to have certain things enabled in php on your server?
Go to the top of the page
 
+Quote Post
karlo
post Mar 8 2005, 05:20 AM
Post #4


Privileged Member
*********

Group: Members
Posts: 618
Joined: 30-October 04
From: Philippines
Member No.: 2,049



QUOTE(jmiller87 @ Mar 8 2005, 11:02 AM)
does this work for anybody or do you have to have certain things enabled in php on your server?
*


I think it will work on any server. Anyways, you can use some built-in scripts like form mailers in cPanel. I love your Avatar. Where did you get it?
Go to the top of the page
 
+Quote Post
mizako
post Mar 8 2005, 12:55 PM
Post #5


Super Member
*********

Group: Members
Posts: 372
Joined: 16-August 04
From: Spain
Member No.: 824



Thanks, i was looking for something like this for a long time. I embedded your code and it seems to work perfectly on my site.
Go to the top of the page
 
+Quote Post
maddog39
post Mar 9 2005, 10:58 PM
Post #6


Super Member
*********

Group: Members
Posts: 208
Joined: 27-January 05
From: LI, New York
Member No.: 3,448



Yes this script is completley self contained and it doesnt need anything special. I havnt seen any mailer scripts in cPanel. Plus perl scripts are a pain in the butt. I like my script alot better. biggrin.gif
Go to the top of the page
 
+Quote Post
GMTech
post Mar 9 2005, 11:20 PM
Post #7


Newbie [Level 2]
**

Group: Members
Posts: 39
Joined: 8-March 05
Member No.: 4,293



That'd good, I will use it when I get my hosting, I'm still slowly making my way up there though... biggrin.gif
Go to the top of the page
 
+Quote Post
GM-University
post Mar 10 2005, 12:43 AM
Post #8


Super Member
*********

Group: Members
Posts: 287
Joined: 23-February 05
Member No.: 3,945



Wow, nice scripts, I too will use them when my hosting is renewed, I will have to try to find a nice purpose of course though, what kind of graphics are displayed with this, you should work on a version where you can add backrounds and stuff. Nice work! smile.gif
Go to the top of the page
 
+Quote Post
maddog39
post Mar 10 2005, 09:24 PM
Post #9


Super Member
*********

Group: Members
Posts: 208
Joined: 27-January 05
From: LI, New York
Member No.: 3,448



Theres nothing, just forms. But if I do-do something fancy it will be copyrighted and stuff. I will have restrictions to and it will be under the GPL lisence like my other PHP Programs. biggrin.gif