in sendmail.php i had to change :
if(empty($visitor) || empty($visitormail) || empty($notes )) {
to:
if(empty($name) || empty($email) || empty($main )) {
but other then that its great![]()

in sendmail.php i had to change :
if(empty($visitor) || empty($visitormail) || empty($notes )) {
to:
if(empty($name) || empty($email) || empty($main )) {
but other then that its great![]()
(\_/)(o.o) This is Bunny. Copy Bunny to('')('') help him achieve world domination.
This is an updated code. Thanks to DJ CJ for pointing this out
Now Call this sendmail.php
Do Not edit that code unless you know what your doing.Code:<?php if(!$email== "" && (!strstr($email,"@") || !strstr($email,"."))) { die ("Invalid Email Address"); } if(empty($name) || empty($email) || empty($main)) { die ("You didn't fill in all the fields"); } $subject = $reason; $message = "Reason: $reason \n Message: $main \n From: $visitor ($visitormail)\n Additional Info : IP = $ip \n "; $from = "From: $email\r\n"; mail("YourEmail", $subject, $message, $from); ?>
Where it saysEdit Youremail to The email address you want it to send it to.Code:mail("YourEmail", $subject, $message, $from);
There you go.
yh thats better. your welcome![]()
(\_/)(o.o) This is Bunny. Copy Bunny to('')('') help him achieve world domination.
How are you declaring $email etc? Post? Get? File?
The Form is post
And do you have
$email = $_POST["email"];
The input form sends the data to sendmail.php
Mentor said what I was trying to say in one post, well done.
Heres update code for you:
HTML Code:<form method="post" action="sendmail.php"> Email Address: <input type="text" name="email" size="30" /><br /> Contact Reason:<br /> <select name="reason" size="1"> <option value="Website Problem">Website Problem</option> <option value="Billing Problem">Billing Problem</option> <option value="Technical Support">Technical Support </option> <option value="Report A Staff Member ">Report A Staff Member</option> <option value="Other">Other (Please Specify in message)</option> </select> <textarea name="main" rows="4" cols="30"></textarea><br /> <input type="submit" value="Send" /> </form>That should work?PHP Code:<?php
$email = $_POST["email"];
$name = $_POST["name"];
$main = $_POST["name"];
$reason = $_POST["reason"];
$ip = $_SERVER["REMOTE_ADDR"];
if(!$email== "" && (!strstr($email,"@") || !strstr($email,".")))
{
die ("Invalid Email Address");
}
if(empty($name) || empty($email) || empty($main)) {
die ("You didn't fill in all the fields");
}
$subject = $reason;
$message = "Reason: $reason \n
Message: $main \n
From: $email \n
Additional Info : IP = $ip \n
";
$from = "From: $email\r\n";
mail("YourEmail", $subject, $message, $from);
?>
Last edited by Blob; 24-02-2007 at 11:08 AM.
Want to hide these adverts? Register an account for free!