<?php
  // Old Background Mailer.
  // This mailer is no longer used.  It is only included to remind users of previous versions to upgrade their mailer settings.

  // load viewer library
  chdir( dirname(__FILE__) ); // change dir to the directory the script is in (so relative paths below work).
  $libraryPath = 'lib/viewer_functions.php';
  $dirsToCheck = array('','../','../../','../../../','../../../../','../../../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

  // send headers (for running through web)
  if (!inCLI()) {
    header("Content-type: text/plain");
    header("Content-Disposition: inline; filename='output.txt'"); // Force IE to display as text and not download file
  }

  // display instructions
  print "Please disable cronjob for: " .__FILE__. "\n\n";
  print "This mailer is no longer used. The new mailer can be enabled by setting up Background Tasks in CMS under: Admin > General Settings > Background Tasks.\n";
  exit;

?>
