View file FFDB/lib/mailer.php

File size: 2.2Kb
<?php
// +----------------------------------------------------------------------+
// |                      Fantastic File Database                         |
// +----------------------------------------------------------------------+
// |                          By Tony Baird                               |
// |                  Copyright (c) 2003 Fantastic Scripts                |
// |                          http://fscripts.com                         |
// +----------------------------------------------------------------------+
// | Fantastic File Database Can be modified freely as long as copyright  | 
// | is intact and this is left at the top of every source file           |
// +----------------------------------------------------------------------+
// | mailer.php                                                           |
// | Date Started: February 18, 2002                                      |
// | Last Modified: February 18, 2003                                     |
// +----------------------------------------------------------------------+
Class Mailer {
	//*************************************************/
    // Setting Up our little mailer
    //*************************************************/
    function Mailer() {
		global $CONFIG;
		if ($CONFIG['mail_method']=="sendmail") {
			$this->mail_method="sendmail";
		} else {
			$this->mail_method="smtp";
		}
    }
	//*************************************************/
    // Sends our Email
    //*************************************************/
	function SendEmail ($email,$subject,$message,$header) {
		global $ffdb,$CONFIG;
		if ($this->mail_method !="smtp") {
			if (!@mail($email,$subject,$message,$header)) {
				$ffdb->Error("Unable to Send Email");
			}
			// Fun we most likely got a windows user on our hands! we get to use smtp joy!
		} else {
			// Currently don't have any smtp mail
			$this->SmtpMail();
		}
	}
	//*************************************************/
    // SMTP Sender which we currently don't have!
    //*************************************************/
	function SmtpMail() {
		$this->Error("Your admin didn't read the documentation smtp feature isn't running yet");
		
	}
}
?>