For example, i only want the sender's email is from "anything@abc.com", if other email like "anything@cde.com" is not allow, only @abc.com is allowed. How should i do that?
let say $_POST['Sender']="anything@abc.com";
$to = "someone@example.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = $_POST['Sender']; $headers = "From:" . $from; mail($to,$subject,$message,$headers); echo "Mail Sent.";