Below is a Mail class I created in PHP, it requires 4 arguments on initiation of the class via the constructor and uses the method ->send() to send the created mail once complete.

class Mail {
        var $to;
        var $subject;
        var $content;
        var $headers;

    function Mail($to, $subject, $content, $from){

                $this->to = $to;
                $this->subject = $subject;
                $this->content = $content;
                $this->headers = "Content-type: text/html; charset=iso-8859-1\r\nFrom: $from";

                $this->content = "<body bgcolor=\"#7a7a7a\">".$content."</body>";
        }

        function send(){
                return mail($this->to, $this->subject, stripslashes($this->content), $this->headers);
        }
}