This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/include/mail.php
Chris Morgan c19a471bd5 Unit tests should disable sending email before they execute, we don't want any accidental emails sent when developers are
running the unit tests to verify functionality. Add commented out example code that will enable developers to disable email via
a define in include/config.php
2006-12-02 19:44:31 +00:00

32 lines
1.2 KiB
PHP

<?php
require_once(BASE."include/config.php");
function mail_appdb($sEmailList,$sSubject,$sMsg)
{
// NOTE: For AppDB developers: If email is disabled return from this function
// immediately. See include/config.php.sample for information
if(defined("DISABLE_EMAIL"))
return;
$sHeaders = "MIME-Version: 1.0\r\n";
$sHeaders .= "From: AppDB <".APPDB_OWNER_EMAIL.">\r\n";
$sHeaders .= "Reply-to: AppDB <".APPDB_OWNER_EMAIL.">\r\n";
$sHeaders .= "X-Priority: 3\r\n";
$sHeaders .= "X-Mailer: ".APPDB_OWNER." mailer\r\n";
$sMsg = trim(ereg_replace("\r\n","\n",$sMsg));
$sMsg = $sSubject."\n-------------------------------------------------------\n".$sMsg."\n\n";
$sMsg .= "Best regards.\n";
$sMsg .= "The AppDB team\n";
$sMsg .= APPDB_ROOT."\n";
$sMsg .= "\n\nIf you don't want to receive any other e-mail, please change your preferences:\n";
$sMsg .= APPDB_ROOT."preferences.php\n";
$bResult = mail(str_replace(" ",",",$sEmailList), "[AppDB] ".$sSubject, $sMsg, $sHeaders, "-f".APPDB_OWNER_EMAIL);
if($bResult)
addmsg("Message sent to: ".$sEmailList, "green");
else
addmsg("Error while sending message to: ".$sEmailList, "red");
return $bResult;
}
?>