Hey there,
Just wondering if anyone can help me with my email form, It doesn't seem to send the actual mail.
Heres the code for the form
PHP Code:
<form method="post" action="sendeail.php"> <!-- DO NOT change ANY of the php sections --> <?php$ipi = getenv("REMOTE_ADDR");$httprefi = getenv ("HTTP_REFERER");$httpagenti = getenv ("HTTP_USER_AGENT");?> <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> <br /> <input name="visitor" type="text" value="Name" size="35" /> <br /> <br /> <input name="visitormail" type="text" value="Email" size="35" /> <br /> <br /> <select name="attn" size="1"> <option value="Insulation" selected="selected">Insulation</option> <option value="Solar">Solar</option> <option value="General Contact">General Contact</option> <option value=" Webmaster ">Webmaster </option> </select> <br /> <br /> <textarea name="notes" rows="4" cols="40">Address</textarea> <br /> <br /> <input type="submit" value="Send Mail" /> Mail Message: <br /> <br /> <br /> </form>
and heres the send script:
PHP Code:
<?php
$ip = $_POST['ip']; $httpref = $_POST['httpref']; $httpagent = $_POST['httpagent']; $visitor = $_POST['visitor']; $visitormail = $_POST['visitormail']; $notes = $_POST['notes'];$attn = $_POST['attn'];
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) {echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n";echo $badinput;die ("Go back! ! ");}
if(empty($visitor) || empty($visitormail) || empty($notes )) {echo "<h2>Use Back - fill in all fields</h2>\n";die ("Use back! ! "); }
$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ; $subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \nAttention: $attn \nMessage: $notes \n From: $visitor ($visitormail)\nAdditional Info : IP = $ip \nBrowser Info: $httpagent \nReferral : $httpref \n";
$from = "From: $visitormail\r\n";
mail("ny-13@hotmail.com", $subject, $message, $from);
?>
<p align="center">Date: <?php echo $todayis ?> <br />Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> ) <br />
Attention: <?php echo $attn ?><br /> Message:<br /> <?php $notesout = str_replace("\r", "<br/>", $notes); echo $notesout; ?> <br /><?php echo $ip ?>
<br /><br /><a href="contact.php"> Next Page </a> </p>