Arghhhhh Stupid mail() problem

Hey guys, just a wuick question:

 
<?php
if(!$_POST["email"]){
 echo "<form method=\"POST\" name=\"formA\" action=\"?pID=".$_GET["pID"]."&col=".$theme."\">
 <textarea name=\"email\" cols=\"60\" rows=\"10\"></textarea>
 <input type=\"submit\" value=\"Send\" />
 </form>";
} else {
 $to  = 'i_eat_lots_of_food@hotmail.com';
 $subject = 'Contact form';
 $message = "<html><body>IP: ".$_SERVER['REMOTE_ADDRESS']."<br />Actual Message: ".$_POST["email"]."</body></html>";
 $headers  = 'MIME-Version: 1.0' . "
";
 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
 $headers .= 'From: my@site.com' . "
";
 mail($to, $subject, $message, $headers);
 echo "Your e-mail has been sent";
}
?>

Does that look right? becaus eit doesn’t sent :confused:

OK, now I had that working, but, now this one doesn’t work

<?php
if(!$_POST["email"]){
	echo "<form method=\"POST\" name=\"formA\" action=\"?pID=".$_GET["pID"]."&col=".$theme."\">
	<b>Ez-Mail:</b><br />Name: <input type=\"input\" name=\"tname\" /><br />
	E-mail: <input type=\"input\" name=\"tmail\" /><br />
	Message:<br />
	<textarea name=\"email\" cols=\"60\" rows=\"10\"></textarea>
	<input type=\"submit\" value=\"Send\" />
	</form>";
} else {
	echo "<b>Ez-Mail:</b>";
	$name = $_POST["tname"];
	$tmail = $_POST["temail"];
	$ip = $_SERVER['REMOTE_ADDRESS'];
	$to  = 'i_eat_lots_of_food@hotmail.com';
	$subject = 'Contact form';
	$message = "<html><body>IP: ".$ip."<br />From: ".$name."<br />Reply-To: ".$tmail."<br />Actual Message: ".$_POST["email"]."</body></html>";
	$headers  = 'MIME-Version: 1.0' . "
";
	$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
	$headers .= 'From: $name' . "
";
	mail($to, $subject, $message, $headers);
	if($name)
		$val = " $name!";
	else
		$val = "!";
	echo "<br />Thankyou$val,<br />Your e-mail has been sent through to my inbox. If there is no-reponse within a few days, please re-send, and I apologise for any inconvenience which it may arise.";
}
?>

You might want to define $theme.

And you forgot your brackets on your if statement.

Try this:

<?php
if(!$_POST['email']){
	echo '
		<form method="POST" name="formA" action="?pID=".$_GET["pID"]."&col=".$theme."">
		<b>Ez-Mail:</b><br />
		Name: <input type="input" name="tname" /><br />
		E-mail: <input type="input" name="tmail" /><br />
		Message:<br />
		<textarea name="email" cols="60" rows="10"></textarea>
		<input type="submit" value="Send" />
		</form>
	';
} else {
	echo "<b>Ez-Mail:</b>";
	$name = $_POST["tname"];
	$tmail = $_POST["temail"];
	$ip = $_SERVER['REMOTE_ADDRESS'];
	$to  = 'i_eat_lots_of_food@hotmail.com';
	$subject = 'Contact form';
	$message = "
		<html><body>IP: ".$ip."<br />
		From: ".$name."<br />
		Reply-To: ".$tmail."<br />
		Actual Message: ".$_POST['email']."</body></html>";
	$headers  = 'MIME-Version: 1.0'.'
';
	$headers .= 'Content-type: text/html; charset=iso-8859-1'.'
';
	$headers .= 'From: $name'.'
';
	mail($to, $subject, $message, $headers);
	if($name) {
		$val = ' '.$name.'!';
	} else {
		$val = "!";
	}
	echo '
		<br />Thank you'.$val.',
		<br />Your e-mail has been sent through to my inbox. If there is no reponse within a few days, please re-send, and I apologise for any inconvenience which may arise.';
}
?>

hey,
thanks for that, but that bit works fine, it’s the MAIL that won’t send to my inbox,a nd theme is defined in another bitof code

If the mail isn’t delivering, I would bet that hotmail isn’t allowing it through.