Hey guys, please help me out.
My site doesn´t sent me any emails anymore. it used to work. Than I tried to adapt the code to give some sort of formmailer and all over sudden it doens´t work anymore...
here´s the code:
the form:
<form name="mailing=" method="POST" action="thankyou.php">
<table>
<tr>
<td align="left">Name:</td><td><input name="name" type="text" value=""></td>
</tr>
<tr>
<td align="left">Lastname:</td><td align="left"><input type="text" name="lastname" value=""></td>
<tr>
<td align="left">Email:</td><td align="left"><input name="email" type="text" value=""></td>
</tr>
<tr>
<td align="right"><input type="reset" value="RESET"></td><td align="left"><input type="submit" value="SUBMIT"></td>
</tr>
</form>
and here´s the php-code:
<?php
$name = $HTTP_POST_VARS["name"];
$lastname = $HTTP_POST_VARS["lastname"];
$email= $HTTP_POST_VARS["email"];
$subject = "new newsletter subscription";
if(strlen($_POST['name']) == 0){
$error="please enter a name.<br>";
}
if(strlen($_POST['lastname']) == 0){
$error="please enter a lastname.<br>";
}
if (!ereg("[a-z0-9]+([-.]?[a-z0-9])+@[a-z0-9]+([-.]?[a-z0-9])+.[a-z]{2,4}", $email)) {
$error.="please enter a valif email.<br>";
}
if($error){
echo "<b><font size='5' color='red'>it didn´t work out:</font></b><br><br>";
echo "<font color='red' size='5'>".$error."<br> Gleich gehts wieder zurück !!</font>";}
else{
$header = "From: <$email>\n";
$header .= "Reply-To: <$email\n";
$header .= "X-Mailer: PHP/" . phpversion(). "\n";
$header .= "X-Sender-IP: $REMOTE_ADDR\n";
$header .= "Content-Type: text/html";
$mailto = "myeamil@adress.de";
$mailfrom = $email;
$body = "<$name><$lastname><$email>\r\n";
?>
also I am entering the variables into a mysql database which still works fine. but there´s ne emails getting in.
PLEASE HELP ME !! ;-)
thanks in advance