// A 'wrapper' function for the mail() function 
function sendEmail($to, $subject, $msg, $headers=""){

	// In the future we can put code here to customize
	// the look of the emails that are generated by our site

	// NOTE: I added this to be able to send emails as HTML
	rtrim($headers);
	$defaultHeaders = 'To: Website Admin <'. $to .'>' . "\r\n";
  	$defaultHeaders .= 'MIME-Version: 1.0'  . "\r\n";
  	$defaultHeaders .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  	$headers = $defaultHeaders . $headers . "\r\n";

	if(mail($to, $subject, $msg, $headers)){
		return true;
	}else{
		return false;
	}

}