<?php//change contactform below to whatever your form name is. I added this to prevent people typing the url in directly and sending emails without the contact form. if (strstr ($_SERVER['HTTP_REFERER'], 'contactform.php')) { $to = "mrkryptic@mrkryptic.com"; //email address to send to $subject = "Ajax Email Form"; //subject when you recieve the mail //do not change these unless you changed the ids of your form $name = $_GET['name']; $email = $_GET['email']; $email_message = $_GET['message']; $id = $_GET['id']; //id of the div around your submit/send button $headers = 'From: ajaxform@mrkryptic.com'; //change this //the main body of the email $message = "You have been given an email via your contact form:\n Name: ". $name ."\n Email Address: " . $email ."\n Message: ". $email_message."\n"; mail($to, $subject, $message, $headers); sleep(3); echo "Message Sent! <br>"; } else { //if someone trys to type the url in directly, e.g. http://www.yourdomain/mailman.php?name=blah&email=blah&message=blah&id=blah //this is the message they will see. echo "Message NOT sent! Use the contact form!<br>"; exit; }?>