Send Email PHP Function


Ever find yourself typing the headers into the php mail() function over and over again?

Try using a standard function and calling it when you need to send mail.

function sendEmail($subject,$content,$from,$to){
  $header = "Content-Type: text/html; charset=iso-8859-1\nFrom:$from";
  if( mail($to, $subject, $content, $header) );
}