Location: PHPKode > scripts > SXD Contact > sxd-contact/send_email.php
<?php

/******************************************************************
SXD Form Mailer version 1.0
Made by: SXDesigns (Kris McGee)
This script is free to use as long as you include a link back to my site
http://www.statix.f2s.com ... If you would like to remove the link, please contact me for
further details. Any questions or comments can be mailed to hide@address.com
See the readme file for information on editing scripts.
Enjoy!
*******************************************************************/

//Set to address and http referer
$send_to="hide@address.com"; // email where you want the mail to go
$refer="http://www.statix.f2s.com"; // This should be your base domain, without a trailing slash


/********************************************************************
Do not edit anything below this line
********************************************************************/

//check to see if form is being sent from our domain
if(eregi("$refer", $HTTP_REFERER)) { 
	$x="3";
   } else {  
    echo("You can only access this script from the correct domain. Further attempts will be logged");
	break;
	      }



//Strip out html from input
htmlspecialchars("$from");
htmlspecialchars("$subject");
htmlspecialchars("$body");

//add in users remote address for security 
$body2="From:".$from."Remote Address:".$HTTP_REMOTE_ADDR." " .$body;

//check to make sure from email is in valid format
if(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $from)) { 
		$xx="1"; 
                                                               } 
else {
 	echo("Your email address is not in valid format, please go back and correctly enter the address");

	  }
	 
//send mail if everthing checks out
if(($x == "3") && ($xx == "1")){
	mail($send_to, $subject, $body2);
	echo("Your mail has been sent. We will reply shortly.<br><br>");
}
else{
echo(" <br>The details of this error are logged.");
}
	 
	 //EOF
	 
?>
Return current item: SXD Contact