PHP Mail Form

Grandmaster

Electronica Addict
Political Access
Joined
3 Feb 2002
Messages
10,574
Hi guys, I'm looking for a PHP Mail Form script for use at my site. I just want it to be really simple and I don't want my email address to be displayed in the code as well, so all the spam bots can't pick it up. Please post any good ones you know of. :)

Thanks
 

Grandmaster

Electronica Addict
Political Access
Joined
3 Feb 2002
Messages
10,574
Simple php mail looks like what I need, I'll try it when I get home. Thanks :)
 

SPeedY_B

I may actually be insane.
Joined
31 Mar 2002
Messages
15,804
The one I wrote for camportal :)
PHP:
case ask:
print "<br />Please enter your details
<form action=\"?page=send\" method=\"post\">
<div>
<br /><label for=\"username\">Your name</label>
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"text\" name=\"usersname\" id=\"username\" /><br />
<br /><label for=\"usersurl\">Your Website (enter \"none\" if you don't have one)</label>
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"text\" name=\"usersurl\" id=\"usersurl\" /><br />
<br /><label for=\"camurl\">Your WebCam URI/Image (<b>must be a direct .jpg link!</b>)</label>
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"text\" name=\"camurl\" id=\"camurl\" /><br />
<br /><label for=\"mailfrom\">Your E-Mail adress (for contact use only, won't be displayed)</label>
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"text\" name=\"mailfrom\" id=\"mailfrom\" /><br />
<br /><label for=\"where\">Where did you hear about us?*</label>
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"text\" name=\"where\" id=\"where\" /><br />
<br /><label for=\"comment\">Questions / Comments?*</label>
<br />&nbsp;&nbsp;&nbsp;&nbsp;
<textarea name=\"comment\" id=\"comment\" rows=\"5\" cols=\"20\" ></textarea><br /><br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"submit\" value=\"Send\" />
</div>
</form>
<br /><br /><br />
<br /><br /><br />
<i>* optional field</i>";
break;
case send:
$fielderror = "<font color=\"red\">Please fill in ALL fields.</font>";
if ($_POST[mailfrom] == NULL) {print "$fielderror";}
elseif ($_POST[camurl] == NULL) {print "$fielderror";}
elseif ($_POST[usersurl] == NULL) {print "$fielderror";}
elseif ($_POST[usersname] == NULL) {print "$fielderror";}
else {
$_POST[usersname] == stripslashes($_POST[usersname]);
mail("E@MAIL.DOMAIN", "Subject","CAM URL : $_POST[camurl]\nUSER name: $_POST[usersname]\nURL: $_POST[usersurl]\nEMAIL: $_POST[mailfrom]\nWHERE: $_POST[where]\nCOMMENTS: $_POST[comment] \n\n\n\n oki, thx.",
     "From: $_POST[mailfrom]\r\n"
    ."X-Mailer: PHP/" . phpversion());
print "
<script language=\"javascript\" type=\"text/javascript\">
setTimeout(\"window.location.replace('?');\",5000);
</script>
<b>Request Sent!</b>
<br /><br />&nbsp;&nbsp;
<table border=\"0\">
<tr>
<td valign=\"top\" width=\"150\">&nbsp;&nbsp;Submitted Information </td>
<td>
<i>From</i><br /> $_POST[usersname] (<a href=\"mailto:$_POST[mailfrom]\">$_POST[mailfrom]</a>)
<br />
<br /><i>Cam URL</i><br /> <a href=\"$_POST[camurl]\">$_POST[camurl]</a>
<br />
<br /><i>Website URL</i><br /> <a href=\"$_POST[usersurl]\">$_POST[usersurl]</a>
</td></tr></table>
<br />
<br />
<br /><b>Your details have been submitted and will be reviewed.<br /><span style=\"font-size:18px;\">this is NOT an instant process.</span></b>
<br />
<br />
<br />You will be re-directed to the <a href=\"?page=one\">main page</a> in a few seconds.
";
}
break;
 

SPeedY_B

I may actually be insane.
Joined
31 Mar 2002
Messages
15,804
Looks like that script could do with a stripslashes(); in there. :)
 

Grandmaster

Electronica Addict
Political Access
Joined
3 Feb 2002
Messages
10,574
Heh, that isn't how I got the email, I just adding the Subject, Message part.
 

Members online

No members online now.

Latest profile posts

hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?
Perris Calderon wrote on Electronic Punk's profile.
Hey EP! All good with me, applying for Microsoft MVP right now, should have done this a while ago.

Notifications don't work, I only found your response by coming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier!

Forum statistics

Threads
62,001
Messages
673,428
Members
5,594
Latest member
RandomCritic