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 = "<body bgcolor=\"#7a7a7a\">".$content."</body>";
        }

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


Share This Article

Related Posts

Comments

There are no comments on this entry.

Trackbacks

There are no trackbacks on this entry.

Add a Comment

Required

Required

Optional

Latest Domains

1. teledyne.com
(5 hours ago)
2. ngtechonology.com
(6 hours ago)
3. nonude.in
(6 hours ago)
4. spicyhunt.com
(12 hours ago)
5. whpromotions.co.uk
(15 hours ago)
6. seslihome.com
(16 hours ago)
7. sesliislam.com
(19 hours ago)
8. woopra.com
(1 day ago)
9. wapdam.com
(1 day ago)
10. 193.105.134.194
(1 day ago)

Services

PHP MySQL Apache Flash Air Java C++ Python