* @package Functions * @subpackage Backend * @version $Id$ */ ?> "; $html .= ""; $html .= "VCD-db notification"; $html .= str_replace('
', '
', $body); $html .= ""; $body = $html; } /* * If you need to use the direct delivery mode and this is running under * Windows or any other platform that does not have enabled the MX * resolution function GetMXRR() , you need to include code that emulates * that function so the class knows which SMTP server it should connect * to deliver the message directly to the recipient SMTP server. */ if(!function_exists("GetMXRR")) { /* * If possible specify in this array the address of at least on local * DNS that may be queried from your network. */ $_NAMESERVERS=array(); include(VCDDB_BASE.'/classes/external/mail/getmxrr.php'); } $smtp->host_name=getenv("HOSTNAME"); /* relay SMTP server address */ $smtp->localhost="localhost"; /* this computer address */ $smtp->host_name = SettingsServices::getSettingsByKey('SMTP_SERVER'); $from = SettingsServices::getSettingsByKey('SMTP_FROM'); $to = $mail_to; /* Set to 1 to deliver directly to the recepient SMTP server */ $smtp->direct_delivery = 0; /* Set to the number of seconds wait for a successful connection to the SMTP server */ $smtp->timeout = 10; $smtp->data_timeout=0; /* Set to the number seconds wait for sending or retrieving data from the SMTP server. Set to 0 to use the same defined in the timeout variable */ /* Set to 1 to output the communication with the SMTP server */ $smtp->debug = SettingsServices::getSettingsByKey('SMTP_DEBUG'); /* Set to 1 to format the debug output as HTML */ $smtp->html_debug = SettingsServices::getSettingsByKey('SMTP_DEBUG'); /* Set to the user name if the server requires authetication */ $smtp->user = SettingsServices::getSettingsByKey('SMTP_USER'); /* Set to the authetication realm, usually the authentication user e-mail domain */ $smtp->realm = SettingsServices::getSettingsByKey('SMTP_REALM'); /* Set to the authetication password */ $smtp->password = SettingsServices::getSettingsByKey('SMTP_PASS'); if($smtp->SendMessage( $from, array( $to ), array( "From: $from", "To: $to", "Subject: ".utf8_decode($subject), "Content-Type: $content_type", "Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z") ), "$body.\n")) { // Check if we are supposed to log this event .. if (VCDLog::isInLogList(VCDLog::EVENT_EMAILS )) { VCDLog::addEntry(VCDLog::EVENT_EMAILS, "Mail to {$to}: subject: {$subject}"); } return true; } else return false; } /** * Get Encryption Key Tokens * * @param string $txt * @param string $encrypt_key * @return string */ function keyED($txt,$encrypt_key) { $encrypt_key = md5($encrypt_key); $ctr=0; $tmp = ""; for ($i=0;$igetCDTitle() . " - ".VCDLanguage::translate('loan.since')." " . date(str_replace('%','',VCDConfig::getDateFormat()), $loanObj->getDateOut()); } $msg .= "

"; $msg .= sprintf(VCDLanguage::translate('mail.returnmovies2'), VCDUtils::getCurrentUser()->getFullname()); return $msg; } /** * Create the body for the email when new movies have been added to VCD-db. * Returns the email body contents. * * @param vcdObj $obj | The vcdObj to notify about * @return string */ function createNotifyEmailBody(vcdObj $obj) { $home = SettingsServices::getSettingsByKey('SITE_HOME'); $home = substr($home, 0, (strlen($home)-1)); $msg = ''; $msg .= sprintf(VCDLanguage::translate('mail.notify'), $home, $obj->getID()); return $msg; } /** * Increment the query counter in the Connection class. * */ function addQueryCount() { VCDConnection::addQueryCount(); } ?>