Location: PHPKode > scripts > Email Robot > emailrobot/include/EMail/EMailSender.php
<?php

//==================================================
// project: EMailRobot
// version: 0.2
// author: ilya nemihin (hide@address.com)
// date: 27-aug-2002
// url: www.nemilya.narod.ru/erobot/
//==================================================

/*

class to send email

*/

require_once('../include/EMail/EMail.php');

class EMailSender extends EMail{

var $headers;
var $mode;

function EMailSender(){
  $this->EMail();

  $this->headers = '';
  $this->setMode( 'real' ); // 'test'
}

  function setHeaders( $headers ){
    $this->headers = $headers;
  }

  function setMode( $mode ){
    $this->mode = $mode;
  }

  function send(){
    switch( $this->mode ){
    case 'real':
      mail( $this->to, $this->subject, $this->body, $this->headers );
      break;
    case 'test':
      echo "To: {$this->to}\nSubject:{$this->subject}\nBody:{$this->body}\nHeaders:{$this->headers}\n";
      break;
    }
  }

}

?>
Return current item: Email Robot