I have the following php code
<?php
$from = $_POST['email'];
$to = "myaddr@myserver.com";
$subject = "new message";
$message = "new message from ". $_POST['email'] ." >>> " . $_POST['message'];
$headers = "From:" . $from;
mail($to,$subject,$message, $headers);
?>
I just started php, so this is the result of copying. I suspect this of being vulnerable, because one could probably just insert a newline char in the email adress field and rewrite my whole mail header for me.
How do I properly escape this? And while you're at it - do you see any other mistakes/vulns?