A PHP Mail Class

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 = "".$content.""; } function send(){ return mail($this->to, $this->subject, stripslashes($this->content), $this->headers); } }
Code language: PHP (php)
Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments