Hey, I have this script I found and I am now using but the box where people enter their name seems pointless as I don't actually see their name in the email I receive. <?php if($_POST['do']=="send") { $recipient="email"; // Set your email here // $subject=$_POST['subject']; $name=$_POST['name']; $email=$_POST['email']; $message=$_POST['message']; $formsend=mail("$recipient", "$subject", "$message", "From: $name ($email)\r\nReply-to:$email"); echo("<p>Your message was successfully sent!</p>"); } ?> Code (markup): How can I actually get the name of the person who tried to contact me?
Well I don't really know much about PHP, I just copied the script, maye you could check the HTML code? <form method="post" action=""> <p>Name:<br> <input name="name" type="text" /> </p> <p>Email:<br> <input name="email" type="text" /> </p> <p>Subject:<br> <input name="subject" type="text" /> </p> <p>Message:<br> <textarea name="message" rows="6"></textarea> <br /> <input type="submit" value="Send" /><input type="hidden" name="do" value="send" /><input type="reset" value="Reset" /> </p></form> Code (markup): Thanks for your help!
what i would suggest to do is the following $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: $name <$email>' . "\r\n"; mail("$recipient", "$subject", "$message", $headers) PHP: (source - http://www.php.net/manual/en/function.mail.php)