mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Issue #70 - update PHPMailer to latest.
New mail entry point to send templated emails, bulk emails etc Add option to mass-send templated emails from admin page 'Notify' function uses the new interface. Sundry detail improvements Other sources of auto-generated emails need converting - signup etc Much more testing needed. Needs competent themer to generate some nice templates.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2010 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
@@ -399,6 +399,7 @@ switch ($action)
|
|||||||
case 'sent' :
|
case 'sent' :
|
||||||
case 'pending' :
|
case 'pending' :
|
||||||
case 'held' :
|
case 'held' :
|
||||||
|
case 'mailshowtemplate' :
|
||||||
if (isset($_POST['etrigger_ecolumns']))
|
if (isset($_POST['etrigger_ecolumns']))
|
||||||
{
|
{
|
||||||
$mailAdmin->mailbodySaveColumnPref($action);
|
$mailAdmin->mailbodySaveColumnPref($action);
|
||||||
@@ -554,6 +555,10 @@ switch ($action)
|
|||||||
$mailAdmin->showEmailList($action, -1, -1);
|
$mailAdmin->showEmailList($action, -1, -1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'mailshowtemplate' : // Show the templated email
|
||||||
|
$mailAdmin->showEmailTemplate($mailId);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'maildelete' : // NOTE:: need to set previous page in form
|
case 'maildelete' : // NOTE:: need to set previous page in form
|
||||||
$mailAdmin->showDeleteConfirm($mailId, $pageMode);
|
$mailAdmin->showDeleteConfirm($mailId, $pageMode);
|
||||||
break;
|
break;
|
||||||
@@ -679,7 +684,14 @@ function saveMailPrefs(&$emessage)
|
|||||||
if (!in_array($_POST['mailer'], array('smtp', 'sendmail', 'php'))) $_POST['mailer'] = 'php';
|
if (!in_array($_POST['mailer'], array('smtp', 'sendmail', 'php'))) $_POST['mailer'] = 'php';
|
||||||
$temp['mailer'] = $_POST['mailer'];
|
$temp['mailer'] = $_POST['mailer'];
|
||||||
// Allow qmail as an option as well - works much as sendmail
|
// Allow qmail as an option as well - works much as sendmail
|
||||||
if ((strpos($_POST['sendmail'],'sendmail') !== FALSE) || (strpos($_POST['sendmail'],'qmail') !== FALSE)) $temp['sendmail'] = $e107->tp->toDB($_POST['sendmail']);
|
if ((strpos($_POST['sendmail'],'sendmail') !== FALSE) || (strpos($_POST['sendmail'],'qmail') !== FALSE))
|
||||||
|
{
|
||||||
|
$temp['sendmail'] = $e107->tp->toDB($_POST['sendmail']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$temp['sendmail'] = '';
|
||||||
|
}
|
||||||
$temp['smtp_server'] = $e107->tp->toDB($_POST['smtp_server']);
|
$temp['smtp_server'] = $e107->tp->toDB($_POST['smtp_server']);
|
||||||
$temp['smtp_username'] = $e107->tp->toDB($_POST['smtp_username']);
|
$temp['smtp_username'] = $e107->tp->toDB($_POST['smtp_username']);
|
||||||
$temp['smtp_password'] = $e107->tp->toDB($_POST['smtp_password']);
|
$temp['smtp_password'] = $e107->tp->toDB($_POST['smtp_password']);
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -2,25 +2,25 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2010 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* e107 Mailout - mail database API and utility routines
|
* e107 Mailout - mail database API and utility routines
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mail_manager_class.php,v $
|
* $URL: https://e107.svn.sourceforge.net/svnroot/e107/trunk/e107_0.8/e107_handlers/redirection_class.php $
|
||||||
* $Revision$
|
* $Id: redirection_class.php 11922 2010-10-27 11:31:18Z secretr $
|
||||||
* $Date$
|
* $Revision: 12125 $
|
||||||
* $Author$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @package e107
|
* @package e107
|
||||||
* @subpackage e107_handlers
|
* @subpackage e107_handlers
|
||||||
* @version $Id$;
|
* @version $Id: mail_manager_class.php 12125 2011-04-08 05:11:38Z e107coders $;
|
||||||
*
|
*
|
||||||
* @todo - consider whether to extract links in text-only emails
|
* @todo - consider whether to extract links in text-only emails
|
||||||
|
* @todo - support separate template for the text part of emails
|
||||||
|
|
||||||
This class isolates the caller from the underlying database used to buffer and send emails.
|
This class isolates the caller from the underlying database used to buffer and send emails.
|
||||||
Also includes a number of useful routines
|
Also includes a number of useful routines
|
||||||
@@ -72,16 +72,33 @@ mail_content - Details of the email to be sent to a number of people
|
|||||||
mail_last_date Don't send after this date/time
|
mail_last_date Don't send after this date/time
|
||||||
mail_title A description of the mailout - not sent
|
mail_title A description of the mailout - not sent
|
||||||
mail_subject Subject line
|
mail_subject Subject line
|
||||||
mail_body Body text
|
mail_body Body text - the 'raw' text as entered/specified by the user
|
||||||
|
mail_body_templated Complete body text after applying the template, but before any variable substitutions
|
||||||
mail_other Evaluates to an array of misc info - cc, bcc, attachments etc
|
mail_other Evaluates to an array of misc info - cc, bcc, attachments etc
|
||||||
|
|
||||||
|
mail_other constituents:
|
||||||
|
mail_sender_email Sender's email address
|
||||||
|
mail_sender_name Sender's name
|
||||||
|
mail_copy_to Any recipients to copy
|
||||||
|
mail_bcopy_to Any recipients to BCC
|
||||||
|
mail_attach Comma-separated list of attachments
|
||||||
|
mail_send_style Send style - HTML, text, template name etc
|
||||||
|
mail_selectors Details of the selection criteria used for recipients (Only used internally)
|
||||||
|
mail_include_images TRUE if to embed images, FALSE to add link to them
|
||||||
|
mail_body_alt If non-empty, use for alternate email text (generally the 'plain text' alternative)
|
||||||
|
mail_overrides If non-empty, any overrides for the mailer, set by the template
|
||||||
|
|
||||||
Within internal arrays, a flat structure is adopted. Variables relating to DB values all begin 'mail_' - others are internal (volatile) control variables
|
|
||||||
|
|
||||||
|
Within internal arrays, a flat structure is adopted, with 'mail_other' merged with the rest of the 'mail_content' values.
|
||||||
|
Variables relating to DB values all begin 'mail_' - others are internal (volatile) control variables
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_mailout.php'); // May be needed by anything loading this class
|
||||||
|
|
||||||
define('MAIL_STATUS_SENT', 0); // Mail sent. Email handler happy, but may have bounced (or may be yet to bounce)
|
define('MAIL_STATUS_SENT', 0); // Mail sent. Email handler happy, but may have bounced (or may be yet to bounce)
|
||||||
define('MAIL_STATUS_BOUNCED', 1);
|
define('MAIL_STATUS_BOUNCED', 1);
|
||||||
define('MAIL_STATUS_CANCELLED', 2);
|
define('MAIL_STATUS_CANCELLED', 2);
|
||||||
@@ -115,8 +132,11 @@ class e107MailManager
|
|||||||
protected $queryCount = array(); // Stores total number of records if SQL_CALC_ROWS is used (index = db object #)
|
protected $queryCount = array(); // Stores total number of records if SQL_CALC_ROWS is used (index = db object #)
|
||||||
protected $currentBatchInfo = array(); // Used during batch send to hold info about current mailout
|
protected $currentBatchInfo = array(); // Used during batch send to hold info about current mailout
|
||||||
protected $currentMailBody = ''; // Buffers current mail body
|
protected $currentMailBody = ''; // Buffers current mail body
|
||||||
|
protected $currentTextBody = ''; // Alternative text body (if required)
|
||||||
|
|
||||||
protected $mailer = NULL; // Mailer class when required
|
protected $mailer = NULL; // Mailer class when required
|
||||||
|
protected $mailOverrides = FALSE; // Any overrides to be passed to the mailer
|
||||||
|
|
||||||
|
|
||||||
// Array defines DB types to be used
|
// Array defines DB types to be used
|
||||||
protected $dbTypes = array(
|
protected $dbTypes = array(
|
||||||
@@ -149,6 +169,7 @@ class e107MailManager
|
|||||||
'mail_title' => 'todb',
|
'mail_title' => 'todb',
|
||||||
'mail_subject' => 'todb',
|
'mail_subject' => 'todb',
|
||||||
'mail_body' => 'todb',
|
'mail_body' => 'todb',
|
||||||
|
'mail_body_templated' => 'todb',
|
||||||
'mail_other' => 'string' // Don't want entities here!
|
'mail_other' => 'string' // Don't want entities here!
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -160,6 +181,7 @@ class e107MailManager
|
|||||||
),
|
),
|
||||||
'mail_content' => array(
|
'mail_content' => array(
|
||||||
'mail_body' => '',
|
'mail_body' => '',
|
||||||
|
'mail_body_templated' => '',
|
||||||
'mail_other' => ''
|
'mail_other' => ''
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -171,9 +193,11 @@ class e107MailManager
|
|||||||
'mail_copy_to' => 1,
|
'mail_copy_to' => 1,
|
||||||
'mail_bcopy_to' => 1,
|
'mail_bcopy_to' => 1,
|
||||||
'mail_attach' => 1,
|
'mail_attach' => 1,
|
||||||
'mail_send_style' => 1,
|
'mail_send_style' => 1, // HTML, text, template name etc
|
||||||
'mail_selectors' => 1, // Only used internally
|
'mail_selectors' => 1, // Only used internally
|
||||||
'mail_include_images' => 1 // Used to determine whether to embed images, or link to them
|
'mail_include_images' => 1, // Used to determine whether to embed images, or link to them
|
||||||
|
'mail_body_alt' => 1, // If non-empty, use for alternate email text (generally the 'plain text' alternative)
|
||||||
|
'mail_overrides' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
// List of fields which are the status counts of an email, and their titles
|
// List of fields which are the status counts of an email, and their titles
|
||||||
@@ -190,9 +214,10 @@ class e107MailManager
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct($overrides = FALSE)
|
||||||
{
|
{
|
||||||
$this->e107 = e107::getInstance();
|
$this->e107 = e107::getInstance();
|
||||||
|
$this->mailOverrides = $overrides;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -269,18 +294,21 @@ class e107MailManager
|
|||||||
$res[$f] = '';
|
$res[$f] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($data['mail_other']))
|
if (isset($data['mail_other']))
|
||||||
{
|
{
|
||||||
$array = new ArrayData;
|
$array = new ArrayData;
|
||||||
$tmp = $array->ReadArray($data['mail_other']);
|
$tmp = $array->ReadArray(str_replace('\\\'', '\'',$data['mail_other'])); // May have escaped data
|
||||||
if (is_array($tmp))
|
if (is_array($tmp))
|
||||||
{
|
{
|
||||||
$res = array_merge($res,$tmp);
|
$res = array_merge($res,$tmp);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$res['Array_ERROR'] = 'No array found';
|
||||||
|
}
|
||||||
unset($res['mail_other']);
|
unset($res['mail_other']);
|
||||||
}
|
}
|
||||||
elseif ($addMissing)
|
if ($addMissing)
|
||||||
{
|
{
|
||||||
foreach ($this->dbOther as $f => $v)
|
foreach ($this->dbOther as $f => $v)
|
||||||
{
|
{
|
||||||
@@ -398,7 +426,7 @@ class e107MailManager
|
|||||||
$array = new ArrayData;
|
$array = new ArrayData;
|
||||||
if (isset($data['mail_other']))
|
if (isset($data['mail_other']))
|
||||||
{
|
{
|
||||||
$tmp = $array->ReadArray($data['mail_other']);
|
$tmp = $array->ReadArray(str_replace('\\\'', '\'',$data['mail_other'])); // May have escaped data
|
||||||
if (is_array($tmp))
|
if (is_array($tmp))
|
||||||
{
|
{
|
||||||
$res = array_merge($res,$tmp);
|
$res = array_merge($res,$tmp);
|
||||||
@@ -414,7 +442,7 @@ class e107MailManager
|
|||||||
}
|
}
|
||||||
if (isset($data['mail_target_info']))
|
if (isset($data['mail_target_info']))
|
||||||
{
|
{
|
||||||
$tmp = $array->ReadArray($data['mail_target_info']);
|
$tmp = $array->ReadArray(str_replace('\\\'', '\'',$data['mail_target_info'])); // May have escaped data
|
||||||
$res['mail_target_info'] = $tmp;
|
$res['mail_target_info'] = $tmp;
|
||||||
}
|
}
|
||||||
return $res;
|
return $res;
|
||||||
@@ -434,7 +462,10 @@ class e107MailManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Internal function to create a db object for our use if none exists
|
|
||||||
|
/**
|
||||||
|
* Internal function to create a db object for our use if none exists
|
||||||
|
*/
|
||||||
protected function checkDB($which = 1)
|
protected function checkDB($which = 1)
|
||||||
{
|
{
|
||||||
if (($which == 1) && ($this->db == NULL))
|
if (($which == 1) && ($this->db == NULL))
|
||||||
@@ -448,7 +479,9 @@ class e107MailManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Internal function to create a mailer object for our use if none exists
|
/**
|
||||||
|
* Internal function to create a mailer object for our use if none exists
|
||||||
|
*/
|
||||||
protected function checkMailer()
|
protected function checkMailer()
|
||||||
{
|
{
|
||||||
if ($this->mailer != NULL) return;
|
if ($this->mailer != NULL) return;
|
||||||
@@ -456,13 +489,29 @@ class e107MailManager
|
|||||||
{
|
{
|
||||||
require_once(e_HANDLER.'mail.php');
|
require_once(e_HANDLER.'mail.php');
|
||||||
}
|
}
|
||||||
$this->mailer = new e107Email; // Could add in overrides here
|
$this->mailer = new e107Email($this->mailOverrides);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the override values for the mailer object.
|
||||||
|
*
|
||||||
|
* @param array $overrides - see mail.php for details of accepted values
|
||||||
|
*
|
||||||
|
* @return boolean TRUE if accepted, FALSE if rejected
|
||||||
|
*/
|
||||||
|
public function setMailOverrides($overrides)
|
||||||
|
{
|
||||||
|
if ($this->mailer != NULL) return FALSE; // Mailer already created - it's too late!
|
||||||
|
$this->mailOverrides = $overrides;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert numeric represntation of mail status to a text string
|
* Convert numeric representation of mail status to a text string
|
||||||
*
|
*
|
||||||
* @param integer $status - numeric value of status
|
* @param integer $status - numeric value of status
|
||||||
* @return string text value
|
* @return string text value
|
||||||
@@ -532,7 +581,7 @@ class e107MailManager
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get next email from selection
|
* Get next email from selection (usually from selectEmails() )
|
||||||
* @return Returns array of email data if available - FALSE if no further data, no active query, or other error
|
* @return Returns array of email data if available - FALSE if no further data, no active query, or other error
|
||||||
*/
|
*/
|
||||||
public function getNextEmail()
|
public function getNextEmail()
|
||||||
@@ -545,7 +594,6 @@ class e107MailManager
|
|||||||
{
|
{
|
||||||
$this->queryActive--;
|
$this->queryActive--;
|
||||||
return $this->dbToBoth($result);
|
return $this->dbToBoth($result);
|
||||||
// return array_merge($this->dbToMail($result), $this->dbToTarget($result));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -569,6 +617,8 @@ class e107MailManager
|
|||||||
* Call to send next email from selection
|
* Call to send next email from selection
|
||||||
*
|
*
|
||||||
* @return Returns TRUE if successful, FALSE on fail (or no more to go)
|
* @return Returns TRUE if successful, FALSE on fail (or no more to go)
|
||||||
|
*
|
||||||
|
* @todo Could maybe save parsed page in cache if more than one email to go
|
||||||
*/
|
*/
|
||||||
public function sendNextEmail()
|
public function sendNextEmail()
|
||||||
{
|
{
|
||||||
@@ -579,6 +629,10 @@ class e107MailManager
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The $email variable has all the email data in 'flat' form, including that of the current recipient.
|
||||||
|
* field $email['mail_target_info'] has variable substitution information relating to the current recipient
|
||||||
|
*/
|
||||||
if (count($this->currentBatchInfo))
|
if (count($this->currentBatchInfo))
|
||||||
{
|
{
|
||||||
//print_a($this->currentBatchInfo);
|
//print_a($this->currentBatchInfo);
|
||||||
@@ -587,6 +641,7 @@ class e107MailManager
|
|||||||
//echo "New email body: {$this->currentBatchInfo['mail_source_id']} != {$email['mail_source_id']}<br />";
|
//echo "New email body: {$this->currentBatchInfo['mail_source_id']} != {$email['mail_source_id']}<br />";
|
||||||
$this->currentBatchInfo = array(); // New source email - clear stored info
|
$this->currentBatchInfo = array(); // New source email - clear stored info
|
||||||
$this->currentMailBody = ''; // ...and clear cache for message body
|
$this->currentMailBody = ''; // ...and clear cache for message body
|
||||||
|
$this->currentTextBody = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($this->currentBatchInfo) == 0)
|
if (count($this->currentBatchInfo) == 0)
|
||||||
@@ -615,45 +670,23 @@ class e107MailManager
|
|||||||
|
|
||||||
if (!$this->currentMailBody)
|
if (!$this->currentMailBody)
|
||||||
{
|
{
|
||||||
$this->currentMailBody = $this->makeEmailBody($email['mail_body'], $email['mail_send_style'], varset($email['mail_include_images'], FALSE));
|
if (isset($email['mail_body_templated']))
|
||||||
}
|
|
||||||
// Do any substitutions
|
|
||||||
$search = array();
|
|
||||||
$replace = array();
|
|
||||||
foreach ($email['mail_target_info'] as $k => $v)
|
|
||||||
{
|
|
||||||
$search[] = '|'.$k.'|';
|
|
||||||
$replace[] = $v;
|
|
||||||
}
|
|
||||||
$email['mail_body'] = str_replace($search, $replace, $this->currentMailBody);
|
|
||||||
$email['send_html'] = ($email['mail_send_style'] != 'textonly');
|
|
||||||
|
|
||||||
// Set up any extra mailer parameters that need it
|
|
||||||
if (!vartrue($email['e107_header']))
|
|
||||||
{
|
|
||||||
$temp = intval($email['mail_recipient_id']).'/'.intval($email['mail_source_id']).'/'.intval($email['mail_target_id']).'/';
|
|
||||||
$email['e107_header'] = $temp.md5($temp); // Set up an ID
|
|
||||||
}
|
|
||||||
if (isset($email['mail_attach']) && (trim($email['mail_attach']) || is_array($email['mail_attach'])))
|
|
||||||
{
|
|
||||||
$downDir = realpath(e_ROOT.$this->e107->getFolder('downloads'));
|
|
||||||
if (is_array($email['mail_attach']))
|
|
||||||
{
|
{
|
||||||
foreach ($email['mail_attach'] as $k => $v)
|
$this->currentMailBody = $email['mail_body_templated'];
|
||||||
{
|
|
||||||
$email['mail_attach'][$k] = $downDir.$v;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$email['mail_attach'] = $downDir.$email['mail_attach'];
|
$this->currentMailBody = $email['mail_body'];
|
||||||
}
|
}
|
||||||
|
$this->currentTextBody = $email['mail_body_alt']; // May be null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$mailToSend = $this->makeEmailBlock($email); // Substitute mail-specific variables, attachments etc
|
||||||
|
|
||||||
// print_a($email);
|
// print_a($email);
|
||||||
|
|
||||||
// Try and send
|
// Try and send
|
||||||
$result = $this->mailer->sendEmail($email['mail_recipient_email'], $email['mail_recipient_name'], $email, TRUE);
|
$result = $this->mailer->sendEmail($email['mail_recipient_email'], $email['mail_recipient_name'], $mailToSend, TRUE);
|
||||||
|
|
||||||
// return; // ************************************************** Temporarily stop DB being updated when line active *****************************
|
// return; // ************************************************** Temporarily stop DB being updated when line active *****************************
|
||||||
|
|
||||||
@@ -744,6 +777,84 @@ class e107MailManager
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Given an email block, creates an array of data compatible with PHPMailer, including any necessary substitutions
|
||||||
|
*/
|
||||||
|
protected function makeEmailBlock($email)
|
||||||
|
{
|
||||||
|
$mailSubsInfo = array(
|
||||||
|
'email_subject' => 'mail_subject',
|
||||||
|
'email_sender_email' => 'mail_sender_email',
|
||||||
|
'email_sender_name' => 'mail_sender_name',
|
||||||
|
// 'email_replyto' - Optional 'reply to' field
|
||||||
|
// 'email_replytonames' - Name(s) corresponding to 'reply to' field - only used if 'replyto' used
|
||||||
|
'email_copy_to' => 'mail_copy_to', // - comma-separated list of cc addresses.
|
||||||
|
//'email_cc_names' - comma-separated list of cc names. Optional, used only if $eml['email_copy_to'] specified
|
||||||
|
'email_bcopy_to' => 'mail_bcopy_to',
|
||||||
|
// 'email_bcc_names' - comma-separated list of bcc names. Optional, used only if $eml['email_copy_to'] specified
|
||||||
|
//'bouncepath' - Sender field (used for bounces)
|
||||||
|
//'returnreceipt' - email address for notification of receipt (reading)
|
||||||
|
//'email_inline_images' - array of files for inline images
|
||||||
|
//'priority' - Email priority (1 = High, 3 = Normal, 5 = low)
|
||||||
|
//'extra_header' - additional headers (format is name: value
|
||||||
|
//'wordwrap' - Set wordwrap value
|
||||||
|
//'split' - If true, sends an individual email to each recipient
|
||||||
|
);
|
||||||
|
$result = array();
|
||||||
|
if (!isset($email['mail_source_id'])) $email['mail_source_id'] = 0;
|
||||||
|
if (!isset($email['mail_target_id'])) $email['mail_target_id'] = 0;
|
||||||
|
if (!isset($email['mail_recipient_id'])) $email['mail_recipient_id'] = 0;
|
||||||
|
foreach ($mailSubsInfo as $k => $v)
|
||||||
|
{
|
||||||
|
if (isset($email[$v]))
|
||||||
|
{
|
||||||
|
$result[$k] = $email[$v];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do any substitutions
|
||||||
|
$search = array();
|
||||||
|
$replace = array();
|
||||||
|
foreach ($email['mail_target_info'] as $k => $v)
|
||||||
|
{
|
||||||
|
$search[] = '|'.$k.'|';
|
||||||
|
$replace[] = $v;
|
||||||
|
}
|
||||||
|
$result['email_body'] = str_replace($search, $replace, $this->currentMailBody);
|
||||||
|
if ($this->currentTextBody)
|
||||||
|
{
|
||||||
|
$result['mail_body_alt'] = str_replace($search, $replace, $this->currentTextBody);
|
||||||
|
}
|
||||||
|
$result['send_html'] = ($email['mail_send_style'] != 'textonly');
|
||||||
|
$result['add_html_header'] = FALSE; // We look after our own headers
|
||||||
|
|
||||||
|
// Set up any extra mailer parameters that need it
|
||||||
|
if (!vartrue($email['e107_header']))
|
||||||
|
{
|
||||||
|
$temp = intval($email['mail_recipient_id']).'/'.intval($email['mail_source_id']).'/'.intval($email['mail_target_id']).'/';
|
||||||
|
$result['e107_header'] = $temp.md5($temp); // Set up an ID
|
||||||
|
}
|
||||||
|
if (isset($email['mail_attach']) && (trim($email['mail_attach']) || is_array($email['mail_attach'])))
|
||||||
|
{
|
||||||
|
$downDir = realpath(e_ROOT.$this->e107->getFolder('downloads'));
|
||||||
|
if (is_array($email['mail_attach']))
|
||||||
|
{
|
||||||
|
foreach ($email['mail_attach'] as $k => $v)
|
||||||
|
{
|
||||||
|
$result['email_attach'][$k] = $downDir.$v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$result['email_attach'] = $downDir.trim($email['mail_attach']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isset($email['mail_overrides']) && is_array($email['mail_overrides'])) $result = array_merge($result, $email['mail_overrides']);
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call to do a number of 'units' of email processing - from a cron job, for example
|
* Call to do a number of 'units' of email processing - from a cron job, for example
|
||||||
* Each 'unit' sends one email from the queue - potentially it could do some other task.
|
* Each 'unit' sends one email from the queue - potentially it could do some other task.
|
||||||
@@ -1314,71 +1425,171 @@ class e107MailManager
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
//-----------------------------------------------------
|
||||||
* Creates email body text according to options
|
// Function call to send a templated email
|
||||||
* @param $text string - text to process
|
//-----------------------------------------------------
|
||||||
* @param $format string - options:
|
|
||||||
* textonly - generate plain text email
|
/**
|
||||||
* texthtml - HTML format email, no theme info
|
* Send an email to any number of recipients, using a template
|
||||||
* texttheme - HTML format email, including current theme stylesheet etc
|
*
|
||||||
* @param boolean $incImages - valid only with HTML output;
|
* The template may contain normal shortcodes, which must already have been loaded. @see e107_themes/email_template.php
|
||||||
* if true any 'absolute' format images are embedded in the source of the email.
|
*
|
||||||
* if FALSE, absolute links are converted to URLs on the local server
|
* The template (or other body text) may also contain field names in the form |USER_NAME| (as used in the bulk mailer edit page). These are
|
||||||
* @return string - updated body
|
* filled in from $templateData - field name corresponds to the array index name (case-sensitive)
|
||||||
*/
|
*
|
||||||
protected function makeEmailBody($text, $format = 'textonly', $incImages = TRUE)
|
* The template definition may contain an array $template['email_overrides'] of values which override normal mailer settings.
|
||||||
|
*
|
||||||
|
* The template definition MUST contain a template variable $template['email_body']
|
||||||
|
*
|
||||||
|
* In general, any template definition which isn't overridden uses the default which should be specified in e_THEME.'templates/email_templates.php'
|
||||||
|
*
|
||||||
|
* There is a presumption that the email is being templated because it contains HTML, although this isn't mandatory.
|
||||||
|
*
|
||||||
|
* Any language string constants required in the template must be defined either by loading the requisite language file prior to calling this
|
||||||
|
* routine, or by loading them in the template file.
|
||||||
|
*
|
||||||
|
* @param array|string $templateName - if a string, the name of the template - information is loaded from theme and default templates.
|
||||||
|
* - if an array, template data as returned by gettemplateInfo() (and defined in the template files)
|
||||||
|
* - if empty, sends a simple email using the default template (much as the original sendemail() function in mail.php)
|
||||||
|
* @param array $emailData - defines the email information (generally as the 'mail_content' and 'mail_other' info above):
|
||||||
|
* $emailData = array(
|
||||||
|
'mail_create_app' => 'notify',
|
||||||
|
'mail_title' => 'NOTIFY',
|
||||||
|
'mail_subject' => $subject,
|
||||||
|
'mail_sender_email' => $pref['siteadminemail'],
|
||||||
|
'mail_sender_name' => $pref['siteadmin'],
|
||||||
|
'mail_send_style' => 'textonly',
|
||||||
|
'mail_notify_complete' => 0, // NEVER notify when this email sent!!!!!
|
||||||
|
'mail_body' => $message
|
||||||
|
);
|
||||||
|
* @param array|string $recipientData - if a string, its the email address of a single recipient.
|
||||||
|
* - if an array, each entry is the data for a single recipient, as the 'mail_recipients' definition above
|
||||||
|
* $recipientData = array('mail_recipient_id' => $row['user_id'],
|
||||||
|
'mail_recipient_name' => $row['user_name'],
|
||||||
|
'mail_recipient_email' => $row['user_email']
|
||||||
|
);
|
||||||
|
* ....and other data as appropriate
|
||||||
|
* @param boolean|array $extra - any additional parameters to be passed to the mailer - as accepted by arraySet method.
|
||||||
|
* These parameters will override any defaults, and any set in the template
|
||||||
|
* if ($extra['mail_force_queue'] is TRUE, the mail will be added to the queue regardless of the number of recipients
|
||||||
|
*
|
||||||
|
* @return boolean TRUE if either added to queue, or sent, successfully (does NOT indicate receipt). FALSE on any error
|
||||||
|
* (Note that with a small number of recipients FALSE indicates that one or more emails weren't sent - some may have been sent successfully)
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function sendEmails($templateName, $emailData, $recipientData, $extra = FALSE)
|
||||||
{
|
{
|
||||||
global $pref;
|
if (!is_array($emailData)) return FALSE;
|
||||||
if ($format == 'textonly')
|
if (!is_array($recipientData))
|
||||||
{ // Plain text email - strip bbcodes etc
|
{
|
||||||
$temp = $this->e107->tp->toHTML($text, TRUE, 'E_BODY_PLAIN'); // Decode bbcodes into HTML, plain text as far as possible etc
|
$recipientData = array('mail_recipient_email' => $recipientData, 'mail_recipient_name' => $recipientData);
|
||||||
return stripslashes(strip_tags($temp)); // Have to do strip_tags() again in case bbcode added some
|
}
|
||||||
|
$emailData['mail_content_status'] = MAIL_STATUS_TEMP;
|
||||||
|
|
||||||
|
if ($templateName == '')
|
||||||
|
{
|
||||||
|
$templateName = varset($email['mail_send_style'], 'textonly'); // Safest default if nothing specified
|
||||||
|
}
|
||||||
|
$templateName = trim($templateName);
|
||||||
|
if ($templateName == '') return FALSE;
|
||||||
|
|
||||||
|
|
||||||
|
// Get template data, override email settings as appropriate
|
||||||
|
require_once(e_HANDLER.'mail_template_class.php');
|
||||||
|
$ourTemplate = new e107MailTemplate();
|
||||||
|
if (!$ourTemplate->setNewTemplate($templateName)) return FALSE; // Probably template not found if error
|
||||||
|
if (!$ourTemplate->makeEmailBody($emailData['mail_body'], varset($emailData['mail_include_images'], TRUE))) return FALSE; // Create body text
|
||||||
|
$emailData['mail_body_templated'] = $ourTemplate->mainBodyText;
|
||||||
|
$this->currentMailBody = $emailData['mail_body_templated']; // In case we send immediately
|
||||||
|
$emailData['mail_body_alt'] = $ourTemplate->altBodyText;
|
||||||
|
$this->currentTextBody = $emailData['mail_body_alt'];
|
||||||
|
if (!isset($emailData['mail_overrides']))
|
||||||
|
{
|
||||||
|
$emailData['mail_overrides'] = $ourTemplate->lastTemplateData['email_overrides'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$forceQueue = FALSE;
|
||||||
|
if (is_array($extra) && isset($extra['mail_force_queue']))
|
||||||
|
{
|
||||||
|
$forceQueue = $extra['mail_force_queue'];
|
||||||
|
unset($extra['mail_force_queue']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$consts = $incImages ? ',consts_abs' : 'consts_full'; // If inline images, absolute constants so we can change them
|
if ((count($recipientData) <= 5) && !$forceQueue) // Arbitrary upper limit for sending multiple emails immediately
|
||||||
|
|
||||||
// HTML format email here
|
|
||||||
$mail_head = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
|
|
||||||
$mail_head .= "<html xmlns='http://www.w3.org/1999/xhtml' >\n";
|
|
||||||
$mail_head .= "<head><meta http-equiv='content-type' content='text/html; charset=utf-8' />\n";
|
|
||||||
if ($format == 'texttheme')
|
|
||||||
{
|
{
|
||||||
$styleFile = THEME.'emailstyle.css';
|
if ($this->mailer == NULL)
|
||||||
if (!is_readable($styleFile)) { $styleFile = e_THEME.$pref['sitetheme']."/style.css"; }
|
{
|
||||||
$style_css = file_get_contents($styleFile);
|
e107_require_once(e_HANDLER.'mail.php');
|
||||||
$mail_head .= "<style>\n".$style_css."\n</style>";
|
$this->mailer = new e107Email($extra);
|
||||||
|
}
|
||||||
|
$tempResult = TRUE;
|
||||||
|
$eCount = 0;
|
||||||
|
|
||||||
|
// @TODO: Generate alt text etc
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($recipientData as $recip)
|
||||||
|
{
|
||||||
|
// Fill in other bits of email
|
||||||
|
$emailData['mail_target_info'] = $recip;
|
||||||
|
$mailToSend = $this->makeEmailBlock($emailData); // Substitute mail-specific variables, attachments etc
|
||||||
|
if (FALSE == $this->mailer->sendEmail($recip['mail_recipient_email'], $recip['mail_recipient_name'], $mailToSend, TRUE))
|
||||||
|
{
|
||||||
|
$tempResult = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Success here
|
||||||
|
if ($eCount == 0)
|
||||||
|
{ // Only send these on first email - otherwise someone could get inundated!
|
||||||
|
unset($emailData['mail_copy_to']);
|
||||||
|
unset($emailData['mail_bcopy_to']);
|
||||||
|
}
|
||||||
|
$eCount++; // Count number of successful emails sent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $tempResult;
|
||||||
}
|
}
|
||||||
$mail_head .= "</head>\n";
|
|
||||||
|
|
||||||
|
// To many recipients to send at once - add to the emailing queue
|
||||||
$message_body = $mail_head."<body>\n";
|
// @TODO - handle any other relevant $extra fields
|
||||||
if ($format == 'texttheme')
|
$result = $this->saveEmail($emailData, TRUE);
|
||||||
|
if ($result === FALSE)
|
||||||
{
|
{
|
||||||
$message_body .= "<div style='padding:10px;width:97%'><div class='forumheader3'>\n";
|
// TODO: Handle error
|
||||||
$message_body .= $this->e107->tp->toHTML($text, TRUE, 'E_BODY'.$consts)."</div></div></body></html>";
|
return FALSE; // Probably nothing else we can do
|
||||||
|
}
|
||||||
|
elseif (is_numeric($result))
|
||||||
|
{
|
||||||
|
$mailMainID = $emailData['mail_source_id'] = $result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$message_body .= $this->e107->tp->toHTML($text, TRUE, 'E_BODY'.$consts)."</body></html>";
|
// TODO: Handle strange error
|
||||||
$message_body = str_replace(""", '"', $message_body);
|
return FALSE; // Probably nothing else we can do
|
||||||
}
|
}
|
||||||
|
$this->mailInitCounters($mailMainID); // Initialise counters for emails added
|
||||||
|
|
||||||
$message_body = stripslashes($message_body);
|
// Now add email addresses to the list
|
||||||
|
foreach ($recipientData as $email)
|
||||||
|
|
||||||
if (!$incImages)
|
|
||||||
{
|
{
|
||||||
// Handle internally generated 'absolute' links - they need the full URL
|
$result = $this->mailAddNoDup($mailMainID, $email, MAIL_STATUS_TEMP);
|
||||||
$message_body = str_replace("src='".e_HTTP, "src='".SITEURL, $message_body);
|
|
||||||
$message_body = str_replace('src="'.e_HTTP, 'src="'.SITEURL, $message_body);
|
|
||||||
$message_body = str_replace("href='".e_HTTP, "src='".SITEURL, $message_body);
|
|
||||||
$message_body = str_replace('href="'.e_HTTP, 'src="'.SITEURL, $message_body);
|
|
||||||
}
|
}
|
||||||
|
$this->mailUpdateCounters($mailMainID); // Update the counters
|
||||||
// print_a($message_body);
|
$counters = $this->mailRetrieveCounters($mailMainID); // Retrieve the counters
|
||||||
return $message_body;
|
if ($counters['add'] == 0)
|
||||||
|
{
|
||||||
|
$this->deleteEmail($mailMainID); // Probably a fault, but precautionary - delete email
|
||||||
|
// Don't treat as an error if no recipients
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->activateEmail($mailMainID, FALSE); // Actually mark the email for sending
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
File diff suppressed because it is too large
Load Diff
@@ -2,16 +2,16 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2010 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* Mailout handling - selector for 'core' users
|
* Mailout handling - selector for 'core' users
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mailout_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/mailout_class.php,v $
|
||||||
* $Revision$
|
* $Revision: 11315 $
|
||||||
* $Date$
|
* $Date: 2010-02-10 18:18:01 +0000 (Wed, 10 Feb 2010) $
|
||||||
* $Author$
|
* $Author: secretr $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
*
|
*
|
||||||
* @package e107
|
* @package e107
|
||||||
* @subpackage e107_handlers
|
* @subpackage e107_handlers
|
||||||
* @version $Id$;
|
* @version $Id: mailout_class.php 11315 2010-02-10 18:18:01Z secretr $;
|
||||||
*
|
*
|
||||||
* @todo last visit date needs XHTML calendar on display, and needs to accept varying input formats
|
* @todo last visit date needs XHTML calendar on display, and needs to accept varying input formats
|
||||||
*/
|
*/
|
||||||
@@ -278,14 +278,20 @@ class core_mailout
|
|||||||
|
|
||||||
$var[0]['html'] = $admin->userClassesTotals('email_to', varset($selectVals['email_to'], ''));
|
$var[0]['html'] = $admin->userClassesTotals('email_to', varset($selectVals['email_to'], ''));
|
||||||
$var[1]['html'] = $frm->selectbox('user_search_name', $u_array, varset($selectVals['user_search_name'], ''),'',TRUE)." ".LAN_MAILOUT_47." ".$frm->text('user_search_value', varset($selectVals['user_search_value'], ''));
|
$var[1]['html'] = $frm->selectbox('user_search_name', $u_array, varset($selectVals['user_search_name'], ''),'',TRUE)." ".LAN_MAILOUT_47." ".$frm->text('user_search_value', varset($selectVals['user_search_value'], ''));
|
||||||
$var[2]['html'] = $admin->comparisonSelect('last_visit_match', varset($selectVals['last_visit_match'], ''))." ".$frm->text('last_visit_date', varset($selectVals['last_visit_date'], 0)); // FIXME: Should include date selector
|
//$var[2]['html'] = $admin->comparisonSelect('last_visit_match', varset($selectVals['last_visit_match'], ''))." ".$frm->text('last_visit_date', varset($selectVals['last_visit_date'], 0));
|
||||||
$var[3]['html'] = $admin->ret_extended_field_list('extended_1_name', varset($selectVals['extended_1_name'], ''), TRUE).LAN_MAILOUT_48." ".$frm->text('extended_1_value',varset($selectVals['extended_1_value'], ''));
|
$var[2]['html'] = $admin->comparisonSelect('last_visit_match', varset($selectVals['last_visit_match'], ''))." ".$admin->makeCalendar('last_visit_date', varset($selectVals['last_visit_date'], 0));
|
||||||
$var[4]['html'] = $admin->ret_extended_field_list('extended_2_name', varset($selectVals['extended_2_name'], ''), TRUE).LAN_MAILOUT_48." ".$frm->text('extended_2_value',varset($selectVals['extended_2_value'],''));
|
|
||||||
|
|
||||||
$var[1]['caption'] = LAN_MAILOUT_46; // User Search Field.
|
$var[1]['caption'] = LAN_MAILOUT_46; // User Search Field.
|
||||||
$var[2]['caption'] = LAN_MAILOUT_56; // User last visit
|
$var[2]['caption'] = LAN_MAILOUT_56; // User last visit
|
||||||
$var[3]['caption'] = LAN_MAILOUT_46; // Extended user field
|
|
||||||
$var[4]['caption'] = LAN_MAILOUT_46; // Extended user field
|
$extFields = $admin->ret_extended_field_list('extended_1_name', varset($selectVals['extended_1_name'], ''), TRUE);
|
||||||
|
if ($extFields !== FALSE) // Only display next bit if UEFs defined
|
||||||
|
{
|
||||||
|
$var[3]['html'] = $extFields.LAN_MAILOUT_48." ".$frm->text('extended_1_value',varset($selectVals['extended_1_value'], ''));
|
||||||
|
$var[4]['html'] = $admin->ret_extended_field_list('extended_2_name', varset($selectVals['extended_2_name'], ''), TRUE).LAN_MAILOUT_48." ".$frm->text('extended_2_value',varset($selectVals['extended_2_value'],''));
|
||||||
|
|
||||||
|
$var[3]['caption'] = LAN_MAILOUT_46; // Extended user field
|
||||||
|
$var[4]['caption'] = LAN_MAILOUT_46; // Extended user field
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // Display existing values
|
else // Display existing values
|
||||||
{
|
{
|
||||||
@@ -320,21 +326,24 @@ class core_mailout
|
|||||||
$var[2]['html'] = $selectVals['last_visit_match'].' '.gmstrftime("%D-%M-%Y",$selectVals['last_visit_date']); //FIXME use e107 date function.
|
$var[2]['html'] = $selectVals['last_visit_match'].' '.gmstrftime("%D-%M-%Y",$selectVals['last_visit_date']); //FIXME use e107 date function.
|
||||||
$var[2]['caption'] = LAN_MAILOUT_56; // User last visit
|
$var[2]['caption'] = LAN_MAILOUT_56; // User last visit
|
||||||
}
|
}
|
||||||
if (vartrue($selectVals['extended_1_name']) && vartrue($selectVals['extended_1_value']))
|
$extFields = $admin->ret_extended_field_list('extended_1_name', varset($selectVals['extended_1_name'], ''), TRUE);
|
||||||
|
if ($extFields !== FALSE)
|
||||||
{
|
{
|
||||||
$var[3]['html'] = $selectVals['extended_1_name'].' '.$selectVals['extended_1_value'];
|
if (vartrue($selectVals['extended_1_name']) && vartrue($selectVals['extended_1_value']))
|
||||||
$var[3]['caption'] = LAN_MAILOUT_46; // Extended user field
|
{
|
||||||
}
|
$var[3]['html'] = $selectVals['extended_1_name'].' '.$selectVals['extended_1_value'];
|
||||||
if (vartrue($selectVals['extended_2_name']) && vartrue($selectVals['extended_2_value']))
|
$var[3]['caption'] = LAN_MAILOUT_46; // Extended user field
|
||||||
{
|
}
|
||||||
$var[4]['html'] = $selectVals['extended_2_name'].' '.$selectVals['extended_2_value'];
|
if (vartrue($selectVals['extended_2_name']) && vartrue($selectVals['extended_2_value']))
|
||||||
$var[4]['caption'] = LAN_MAILOUT_46; // Extended user field
|
{
|
||||||
|
$var[4]['html'] = $selectVals['extended_2_name'].' '.$selectVals['extended_2_value'];
|
||||||
|
$var[4]['caption'] = LAN_MAILOUT_46; // Extended user field
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $var;
|
return $var;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,304 +1,273 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* Forum plugin notify configuration
|
* Forum plugin notify configuration
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/notify_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/notify_class.php,v $
|
||||||
* $Revision$
|
* $Revision$
|
||||||
* $Date$
|
* $Date$
|
||||||
* $Author$
|
* $Author$
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package e107
|
* @package e107
|
||||||
* @subpackage e107_handlers
|
* @subpackage e107_handlers
|
||||||
* @version $Id$;
|
* @version $Id$;
|
||||||
*
|
*
|
||||||
* Handler for 'notify' events - sends email notifications to the appropriate user groups
|
* Handler for 'notify' events - sends email notifications to the appropriate user groups
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
class notify
|
class notify
|
||||||
{
|
{
|
||||||
var $notify_prefs;
|
var $notify_prefs;
|
||||||
|
|
||||||
function notify()
|
function notify()
|
||||||
{
|
{
|
||||||
global $e_event;
|
global $e_event;
|
||||||
|
|
||||||
$this->notify_prefs = e107::getConfig("notify")->getPref();
|
$this->notify_prefs = e107::getConfig('notify')->getPref();
|
||||||
|
|
||||||
if(varset($this->notify_prefs['event']))
|
if(varset($this->notify_prefs['event']))
|
||||||
{
|
{
|
||||||
foreach ($this->notify_prefs['event'] as $id => $status)
|
foreach ($this->notify_prefs['event'] as $id => $status)
|
||||||
{
|
{
|
||||||
if ($status['class'] != 255)
|
if ($status['class'] != 255)
|
||||||
{
|
{
|
||||||
$e_event->register($id, 'notify_'.$id);
|
$e_event->register($id, 'notify_'.$id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php');
|
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an email notification following an event.
|
* Send an email notification following an event.
|
||||||
*
|
*
|
||||||
* For up to a (hard-coded) number of recipients, the mail is sent immediately.
|
* The email is sent via a common interface, which will send immediately for small numbers of recipients, and queue for larger.
|
||||||
* Otherwise its added to the queue
|
*
|
||||||
*
|
* @param string $id - identifies event actions
|
||||||
* @param string $id - identifies event actions
|
* @param string $subject - subject for email
|
||||||
* @param string $subject - subject for email
|
* @param string $message - email message body
|
||||||
* @param string $message - email message body
|
* @return none
|
||||||
* @return none
|
*
|
||||||
*
|
* @todo handle 'everyone except' clauses (email address filter done)
|
||||||
* @todo handle 'everyone except' clauses (email address filter done)
|
* @todo set up pref to not notify originator of event which caused notify (see $blockOriginator)
|
||||||
* @todo set up pref to not notify originator of event which caused notify (see $blockOriginator)
|
*/
|
||||||
*/
|
function send($id, $subject, $message)
|
||||||
function send($id, $subject, $message)
|
{
|
||||||
{
|
$e107 = e107::getInstance();
|
||||||
$e107 = e107::getInstance();
|
|
||||||
|
$subject = $e107->tp->toEmail(SITENAME.': '.$subject);
|
||||||
$subject = $e107->tp->toEmail(SITENAME.': '.$subject);
|
$message = $e107->tp->toEmail($message);
|
||||||
$message = $e107->tp->toEmail($message);
|
$emailFilter = '';
|
||||||
$emailFilter = '';
|
$notifyTarget = $this->notify_prefs['event'][$id]['class'];
|
||||||
$notifyTarget = $this->notify_prefs['event'][$id]['class'];
|
if ($notifyTarget == '-email')
|
||||||
if ($notifyTarget == '-email')
|
{
|
||||||
{
|
$emailFilter = $this->notify_prefs['event'][$id]['email'];
|
||||||
$emailFilter = $this->notify_prefs['event'][$id]['email'];
|
}
|
||||||
}
|
$blockOriginator = FALSE; // TODO: set this using a pref
|
||||||
$blockOriginator = FALSE; // TODO: set this using a pref
|
$recipients = array();
|
||||||
if (is_numeric($this -> notify_prefs['event'][$id]['class']))
|
|
||||||
{
|
if ($notifyTarget == 'email')
|
||||||
switch ($notifyTarget)
|
{ // Single email address - that can always go immediately
|
||||||
{
|
if (!$blockOriginator || ($this->notify_prefs['event'][$id]['email'] != USEREMAIL))
|
||||||
case e_UC_MAINADMIN :
|
{
|
||||||
$qry = "`user_admin` = 1 AND `user_perms` = '0' AND `user_ban` = 0";
|
$recipients[] = array(
|
||||||
break;
|
'mail_recipient_email' => $this->notify_prefs['event'][$id]['email']
|
||||||
case e_UC_ADMIN :
|
);
|
||||||
$qry = "`user_admin` = 1 AND `user_ban` = 0";
|
}
|
||||||
break;
|
}
|
||||||
case e_UC_MEMBER :
|
elseif (is_numeric($this->notify_prefs['event'][$id]['class']))
|
||||||
$qry = "`user_ban` = 0";
|
{
|
||||||
break;
|
switch ($notifyTarget)
|
||||||
default :
|
{
|
||||||
$qry = "user_ban = 0 AND user_class REGEXP '(^|,)(".$this->notify_prefs['event'][$id]['class'].")(,|$)'";
|
case e_UC_MAINADMIN :
|
||||||
break;
|
$qry = "`user_admin` = 1 AND `user_perms` = '0' AND `user_ban` = 0";
|
||||||
}
|
break;
|
||||||
$qry = 'SELECT user_id,user_name,user_email FROM `#user` WHERE '.$qry;
|
case e_UC_ADMIN :
|
||||||
if ($blockOriginator)
|
$qry = "`user_admin` = 1 AND `user_ban` = 0";
|
||||||
{
|
break;
|
||||||
$qry .= ' AND `user_id` != '.USERID;
|
case e_UC_MEMBER :
|
||||||
}
|
$qry = "`user_ban` = 0";
|
||||||
if (FALSE !== ($count = $e107->sql->db_Select_gen($qry)))
|
break;
|
||||||
{
|
default :
|
||||||
if ($count <= 5)
|
$qry = "user_ban = 0 AND user_class REGEXP '(^|,)(".$this->notify_prefs['event'][$id]['class'].")(,|$)'";
|
||||||
{ // Arbitrary number below which we send emails immediately
|
break;
|
||||||
e107_require_once(e_HANDLER.'mail.php');
|
}
|
||||||
while ($email = $e107->sql->db_Fetch())
|
$qry = 'SELECT user_id,user_name,user_email FROM `#user` WHERE '.$qry;
|
||||||
{
|
if ($blockOriginator)
|
||||||
if ($email['user_email'] != $emailFilter)
|
{
|
||||||
{
|
$qry .= ' AND `user_id` != '.USERID;
|
||||||
sendemail($email['user_email'], $subject, $message, $email['user_name']);
|
}
|
||||||
}
|
if (FALSE !== ($count = $e107->sql->db_Select_gen($qry)))
|
||||||
}
|
{
|
||||||
}
|
// Now add email addresses to the list
|
||||||
else
|
while ($row = $e107->sql->db_Fetch(MYSQL_ASSOC))
|
||||||
{ // Otherwise add to mailout queue
|
{
|
||||||
require_once(e_HANDLER.'mail_manager_class.php');
|
if ($row['user_email'] != $emailFilter)
|
||||||
$mailer = new e107MailManager;
|
{
|
||||||
|
$recipients[] = array('mail_recipient_id' => $row['user_id'],
|
||||||
|
'mail_recipient_name' => $row['user_name'], // Should this use realname?
|
||||||
// Start by creating the mail body
|
'mail_recipient_email' => $row['user_email']
|
||||||
$mailData = array(
|
);
|
||||||
'mail_content_status' => MAIL_STATUS_TEMP,
|
}
|
||||||
'mail_create_app' => 'notify',
|
}
|
||||||
'mail_title' => 'NOTIFY',
|
}
|
||||||
'mail_subject' => $subject,
|
}
|
||||||
'mail_sender_email' => $pref['siteadminemail'],
|
|
||||||
'mail_sender_name' => $pref['siteadmin'],
|
if (count($recipients))
|
||||||
'mail_send_style' => 'textonly',
|
{
|
||||||
'mail_notify_complete' => 0, // NEVER notify when this email sent!!!!!
|
require_once(e_HANDLER.'mail_manager_class.php');
|
||||||
'mail_body' => $message
|
$mailer = new e107MailManager;
|
||||||
);
|
|
||||||
$result = $mailer->saveEmail($mailData, TRUE);
|
// Create the mail body
|
||||||
if (is_numeric($result))
|
$mailData = array(
|
||||||
{
|
'mail_content_status' => MAIL_STATUS_TEMP,
|
||||||
$mailMainID = $mailData['mail_source_id'] = $result;
|
'mail_create_app' => 'notify',
|
||||||
}
|
'mail_title' => 'NOTIFY',
|
||||||
else
|
'mail_subject' => $subject,
|
||||||
{
|
'mail_sender_email' => e107::getPref('siteadminemail'),
|
||||||
// TODO: Handle error
|
'mail_sender_name' => e107::getPref('siteadmin'),
|
||||||
return; // Probably nothing else we can do
|
'mail_send_style' => 'textonly',
|
||||||
}
|
'mail_notify_complete' => 0, // NEVER notify when this email sent!!!!!
|
||||||
$mailer->mailInitCounters($mailMainID); // Initialise counters for emails added
|
'mail_body' => $message
|
||||||
|
);
|
||||||
// Now add email addresses to the list
|
$result = $mailer->sendEmails('NOTIFY_TEMPLATE', $mailData, $recipients);
|
||||||
while ($row = $e107->sql->db_Fetch(MYSQL_ASSOC))
|
$e107->admin_log->e_log_event(10,-1,'NOTIFY',$subject,$message,FALSE,LOG_TO_ROLLING);
|
||||||
{
|
}
|
||||||
if ($row['user_email'] != $emailFilter)
|
}
|
||||||
{
|
}
|
||||||
$uTarget = array('mail_recipient_id' => $row['user_id'],
|
|
||||||
'mail_recipient_name' => $row['user_name'], // Should this use realname?
|
|
||||||
'mail_recipient_email' => $row['user_email']
|
|
||||||
);
|
|
||||||
$result = $mailer->mailAddNoDup($mailMainID, $uTarget, MAIL_STATUS_TEMP);
|
//DEPRECATED, BC, call the method only when needed, $e107->notify caught by __get()
|
||||||
}
|
global $nt;
|
||||||
}
|
$nt = e107::getNotify(); //TODO - find & replace $nt, $e107->notify
|
||||||
$mailer->mailUpdateCounters($mailMainID); // Update the counters
|
|
||||||
$counters = $mailer->mailRetrieveCounters($mailMainID); // Retrieve the counters
|
|
||||||
if ($counters['add'] == 0)
|
function notify_usersup($data)
|
||||||
{
|
{
|
||||||
$mailer->deleteEmail($mailMainID); // Probably a fault, but precautionary - delete email
|
global $nt;
|
||||||
}
|
foreach ($data as $key => $value)
|
||||||
else
|
{
|
||||||
{
|
if($key != "password1" && $key != "password2" && $key != "email_confirm" && $key != "register")
|
||||||
$mailer->activateEmail($mailMainID, FALSE); // Actually mark the email for sending
|
{
|
||||||
}
|
if(is_array($value)) // show user-extended values.
|
||||||
}
|
{
|
||||||
$e107->admin_log->e_log_event(10,-1,'NOTIFY',$subject,$message,FALSE,LOG_TO_ROLLING);
|
foreach($value as $k => $v)
|
||||||
}
|
{
|
||||||
}
|
$message .= str_replace("user_","",$k).': '.$v.'<br />';
|
||||||
elseif ($notifyTarget == 'email')
|
}
|
||||||
{ // Single email address - that can always go immediately
|
}
|
||||||
if (!$blockOriginator || ($this->notify_prefs['event'][$id]['email'] != USEREMAIL))
|
else
|
||||||
{
|
{
|
||||||
e107_require_once(e_HANDLER.'mail.php');
|
$message .= $key.': '.$value.'<br />';
|
||||||
sendemail($this->notify_prefs['event'][$id]['email'], $subject, $message);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
$nt->send('usersup', NT_LAN_US_1, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function notify_userveri($data)
|
||||||
|
{
|
||||||
|
global $nt, $e107;
|
||||||
//DEPRECATED, BC, call the method only when needed, $e107->notify caught by __get()
|
$msgtext = NT_LAN_UV_2.$data['user_id']."\n";
|
||||||
global $nt;
|
$msgtext .= NT_LAN_UV_3.$data['user_loginname']."\n";
|
||||||
$nt = e107::getNotify(); //TODO - find & replace $nt, $e107->notify
|
$msgtext .= NT_LAN_UV_4.e107::getIPHandler()->getIP(FALSE);
|
||||||
|
$nt->send('userveri', NT_LAN_UV_1, $msgtext);
|
||||||
|
}
|
||||||
function notify_usersup($data)
|
|
||||||
{
|
function notify_login($data)
|
||||||
global $nt;
|
{
|
||||||
foreach ($data as $key => $value)
|
global $nt;
|
||||||
{
|
foreach ($data as $key => $value) {
|
||||||
if($key != "password1" && $key != "password2" && $key != "email_confirm" && $key != "register")
|
$message .= $key.': '.$value.'<br />';
|
||||||
{
|
}
|
||||||
if(is_array($value)) // show user-extended values.
|
$nt->send('login', NT_LAN_LI_1, $message);
|
||||||
{
|
}
|
||||||
foreach($value as $k => $v)
|
|
||||||
{
|
function notify_logout()
|
||||||
$message .= str_replace("user_","",$k).': '.$v.'<br />';
|
{
|
||||||
}
|
global $nt;
|
||||||
}
|
$nt->send('logout', NT_LAN_LO_1, USERID.'. '.USERNAME.' '.NT_LAN_LO_2);
|
||||||
else
|
}
|
||||||
{
|
|
||||||
$message .= $key.': '.$value.'<br />';
|
function notify_flood($data)
|
||||||
}
|
{
|
||||||
}
|
global $nt;
|
||||||
}
|
$nt->send('flood', NT_LAN_FL_1, NT_LAN_FL_2.': '.$data);
|
||||||
$nt->send('usersup', NT_LAN_US_1, $message);
|
}
|
||||||
}
|
|
||||||
|
function notify_subnews($data)
|
||||||
function notify_userveri($data)
|
{
|
||||||
{
|
global $nt,$tp;
|
||||||
global $nt, $e107;
|
foreach ($data as $key => $value) {
|
||||||
$msgtext = NT_LAN_UV_2.$data['user_id']."\n";
|
$message .= $key.': '.$value.'<br />';
|
||||||
$msgtext .= NT_LAN_UV_3.$data['user_loginname']."\n";
|
}
|
||||||
$msgtext .= NT_LAN_UV_4.e107::getIPHandler()->getIP(FALSE);
|
$nt->send('subnews', NT_LAN_SN_1, $message);
|
||||||
$nt->send('userveri', NT_LAN_UV_1, $msgtext);
|
}
|
||||||
}
|
|
||||||
|
function notify_newspost($data)
|
||||||
function notify_login($data)
|
{
|
||||||
{
|
$message = '<b>'.$data['news_title'].'</b>';
|
||||||
global $nt;
|
if (vartrue($data['news_summary'])) $message .= '<br /><br />'.$data['news_summary'];
|
||||||
foreach ($data as $key => $value) {
|
if (vartrue($data['news_body'])) $message .= '<br /><br />'.$data['news_body'];
|
||||||
$message .= $key.': '.$value.'<br />';
|
if (vartrue($data['news_extended'])) $message.= '<br /><br />'.$data['news_extended'];
|
||||||
}
|
e107::getNotify()->send('newspost', $data['news_title'], e107::getParser()->text_truncate(e107::getParser()->toDB($message), 400, '...'));
|
||||||
$nt->send('login', NT_LAN_LI_1, $message);
|
}
|
||||||
}
|
|
||||||
|
function notify_newsupd($data)
|
||||||
function notify_logout()
|
{
|
||||||
{
|
$message = '<b>'.$data['news_title'].'</b>';
|
||||||
global $nt;
|
if (vartrue($data['news_summary'])) $message .= '<br /><br />'.$data['news_summary'];
|
||||||
$nt->send('logout', NT_LAN_LO_1, USERID.'. '.USERNAME.' '.NT_LAN_LO_2);
|
if (vartrue($data['news_body'])) $message .= '<br /><br />'.$data['news_body'];
|
||||||
}
|
if (vartrue($data['news_extended'])) $message.= '<br /><br />'.$data['news_extended'];
|
||||||
|
e107::getNotify()->send('newsupd', NT_LAN_NU_1.': '.$data['news_title'], e107::getParser()->text_truncate(e107::getParser()->toDB($message), 400, '...'));
|
||||||
function notify_flood($data)
|
}
|
||||||
{
|
|
||||||
global $nt;
|
function notify_newsdel($data)
|
||||||
$nt->send('flood', NT_LAN_FL_1, NT_LAN_FL_2.': '.$data);
|
{
|
||||||
}
|
global $nt;
|
||||||
|
$nt->send('newsdel', NT_LAN_ND_1, NT_LAN_ND_2.': '.$data);
|
||||||
function notify_subnews($data)
|
}
|
||||||
{
|
|
||||||
global $nt,$tp;
|
|
||||||
foreach ($data as $key => $value) {
|
function notify_maildone($data)
|
||||||
$message .= $key.': '.$value.'<br />';
|
{
|
||||||
}
|
$message = '<b>'.$data['mail_subject'].'</b><br /><br />'.$data['mail_body'];
|
||||||
$nt->send('subnews', NT_LAN_SN_1, $message);
|
e107::getNotify()->send('maildone', NT_LAN_ML_1.': '.$data['mail_subject'], $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
function notify_newspost($data)
|
|
||||||
{
|
function notify_fileupload($data)
|
||||||
$message = '<b>'.$data['news_title'].'</b>';
|
{
|
||||||
if (vartrue($data['news_summary'])) $message .= '<br /><br />'.$data['news_summary'];
|
global $nt;
|
||||||
if (vartrue($data['news_body'])) $message .= '<br /><br />'.$data['news_body'];
|
$message = '<b>'.$data['upload_name'].'</b><br /><br />'.$data['upload_description'].'<br /><br />'.$data['upload_size'].'<br /><br />'.$data['upload_user'];
|
||||||
if (vartrue($data['news_extended'])) $message.= '<br /><br />'.$data['news_extended'];
|
$nt->send('fileupload', $data['upload_name'], $message);
|
||||||
e107::getNotify()->send('newspost', $data['news_title'], e107::getParser()->text_truncate(e107::getParser()->toDB($message), 400, '...'));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function notify_newsupd($data)
|
if (isset($nt->notify_prefs['plugins']))
|
||||||
{
|
{
|
||||||
$message = '<b>'.$data['news_title'].'</b>';
|
foreach ($nt->notify_prefs['plugins'] as $plugin_id => $plugin_settings)
|
||||||
if (vartrue($data['news_summary'])) $message .= '<br /><br />'.$data['news_summary'];
|
{
|
||||||
if (vartrue($data['news_body'])) $message .= '<br /><br />'.$data['news_body'];
|
if(is_readable(e_PLUGIN.$plugin_id.'/e_notify.php'))
|
||||||
if (vartrue($data['news_extended'])) $message.= '<br /><br />'.$data['news_extended'];
|
{
|
||||||
e107::getNotify()->send('newsupd', NT_LAN_NU_1.': '.$data['news_title'], e107::getParser()->text_truncate(e107::getParser()->toDB($message), 400, '...'));
|
require_once(e_PLUGIN.$plugin_id.'/e_notify.php');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function notify_newsdel($data)
|
}
|
||||||
{
|
|
||||||
global $nt;
|
|
||||||
$nt->send('newsdel', NT_LAN_ND_1, NT_LAN_ND_2.': '.$data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function notify_maildone($data)
|
|
||||||
{
|
|
||||||
$message = '<b>'.$data['mail_subject'].'</b><br /><br />'.$data['mail_body'];
|
|
||||||
e107::getNotify()->send('maildone', NT_LAN_ML_1.': '.$data['mail_subject'], $message);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function notify_fileupload($data)
|
|
||||||
{
|
|
||||||
global $nt;
|
|
||||||
$message = '<b>'.$data['upload_name'].'</b><br /><br />'.$data['upload_description'].'<br /><br />'.$data['upload_size'].'<br /><br />'.$data['upload_user'];
|
|
||||||
$nt->send('fileupload', $data['upload_name'], $message);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($nt->notify_prefs['plugins']))
|
|
||||||
{
|
|
||||||
foreach ($nt->notify_prefs['plugins'] as $plugin_id => $plugin_settings)
|
|
||||||
{
|
|
||||||
if(is_readable(e_PLUGIN.$plugin_id.'/e_notify.php'))
|
|
||||||
{
|
|
||||||
require_once(e_PLUGIN.$plugin_id.'/e_notify.php');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
File diff suppressed because it is too large
Load Diff
@@ -2,15 +2,15 @@
|
|||||||
/*~ class.pop3.php
|
/*~ class.pop3.php
|
||||||
.---------------------------------------------------------------------------.
|
.---------------------------------------------------------------------------.
|
||||||
| Software: PHPMailer - PHP email class |
|
| Software: PHPMailer - PHP email class |
|
||||||
| Version: 5.0.0 |
|
| Version: 5.2.2 |
|
||||||
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
|
| Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ |
|
||||||
| Info: http://phpmailer.sourceforge.net |
|
|
||||||
| Support: http://sourceforge.net/projects/phpmailer/ |
|
|
||||||
| ------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------- |
|
||||||
| Admin: Andy Prevost (project admininistrator) |
|
| Admin: Jim Jagielski (project admininistrator) |
|
||||||
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
|
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
|
||||||
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
|
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
|
||||||
|
| : Jim Jagielski (jimjag) jimjag@gmail.com |
|
||||||
| Founder: Brent R. Matzelle (original founder) |
|
| Founder: Brent R. Matzelle (original founder) |
|
||||||
|
| Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved. |
|
||||||
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
|
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
|
||||||
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
||||||
| ------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------- |
|
||||||
@@ -19,11 +19,6 @@
|
|||||||
| This program is distributed in the hope that it will be useful - WITHOUT |
|
| This program is distributed in the hope that it will be useful - WITHOUT |
|
||||||
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||||
| FITNESS FOR A PARTICULAR PURPOSE. |
|
| FITNESS FOR A PARTICULAR PURPOSE. |
|
||||||
| ------------------------------------------------------------------------- |
|
|
||||||
| We offer a number of paid services (www.codeworxtech.com): |
|
|
||||||
| - Web Hosting on highly optimized fast and secure servers |
|
|
||||||
| - Technology Consulting |
|
|
||||||
| - Oursourcing (highly qualified programmers and graphic designers) |
|
|
||||||
'---------------------------------------------------------------------------'
|
'---------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -33,21 +28,21 @@
|
|||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author Andy Prevost
|
* @author Andy Prevost
|
||||||
* @author Marcus Bointon
|
* @author Marcus Bointon
|
||||||
|
* @author Jim Jagielski
|
||||||
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
|
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
|
||||||
* @version $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POP Before SMTP Authentication Class
|
* PHP POP-Before-SMTP Authentication Class
|
||||||
* Version 5.0.0
|
|
||||||
*
|
*
|
||||||
* Author: Richard Davey (rich@corephp.co.uk)
|
* Version 5.2.2
|
||||||
* Modifications: Andy Prevost
|
*
|
||||||
* License: LGPL, see PHPMailer License
|
* @license: LGPL, see PHPMailer License
|
||||||
*
|
*
|
||||||
* Specifically for PHPMailer to allow POP before SMTP authentication.
|
* Specifically for PHPMailer to allow POP before SMTP authentication.
|
||||||
* Does not yet work with APOP - if you have an APOP account, contact Richard Davey
|
* Does not yet work with APOP - if you have an APOP account, contact Jim Jagielski
|
||||||
* and we can test changes to this script.
|
* and we can test changes to this script.
|
||||||
*
|
*
|
||||||
* This class is based on the structure of the SMTP class originally authored by Chris Ryan
|
* This class is based on the structure of the SMTP class originally authored by Chris Ryan
|
||||||
@@ -56,7 +51,9 @@
|
|||||||
* required for POP3 connection, authentication and disconnection.
|
* required for POP3 connection, authentication and disconnection.
|
||||||
*
|
*
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author Richard Davey
|
* @author Richard Davey (orig) <rich@corephp.co.uk>
|
||||||
|
* @author Andy Prevost
|
||||||
|
* @author Jim Jagielski
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class POP3 {
|
class POP3 {
|
||||||
@@ -114,12 +111,27 @@ class POP3 {
|
|||||||
*/
|
*/
|
||||||
public $password;
|
public $password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the POP3 PHPMailer Version number
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $Version = '5.2.2';
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
// PROPERTIES, PRIVATE AND PROTECTED
|
// PROPERTIES, PRIVATE AND PROTECTED
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var resource Resource handle for the POP connection socket
|
||||||
|
*/
|
||||||
private $pop_conn;
|
private $pop_conn;
|
||||||
|
/**
|
||||||
|
* @var boolean Are we connected?
|
||||||
|
*/
|
||||||
private $connected;
|
private $connected;
|
||||||
|
/**
|
||||||
|
* @var array Error container
|
||||||
|
*/
|
||||||
private $error; // Error log array
|
private $error; // Error log array
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,10 +149,12 @@ class POP3 {
|
|||||||
* Combination of public events - connect, login, disconnect
|
* Combination of public events - connect, login, disconnect
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $host
|
* @param string $host
|
||||||
* @param integer $port
|
* @param bool|int $port
|
||||||
* @param integer $tval
|
* @param bool|int $tval
|
||||||
* @param string $username
|
* @param string $username
|
||||||
* @param string $password
|
* @param string $password
|
||||||
|
* @param int $debug_level
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {
|
public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {
|
||||||
$this->host = $host;
|
$this->host = $host;
|
||||||
@@ -190,7 +204,7 @@ class POP3 {
|
|||||||
* Connect to the POP3 server
|
* Connect to the POP3 server
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $host
|
* @param string $host
|
||||||
* @param integer $port
|
* @param bool|int $port
|
||||||
* @param integer $tval
|
* @param integer $tval
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
@@ -259,7 +273,7 @@ class POP3 {
|
|||||||
$this->connected = true;
|
$this->connected = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -300,12 +314,9 @@ class POP3 {
|
|||||||
|
|
||||||
if ($this->checkResponse($pop3_response)) {
|
if ($this->checkResponse($pop3_response)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -404,4 +415,4 @@ class POP3 {
|
|||||||
|
|
||||||
// End of class
|
// End of class
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@@ -2,15 +2,15 @@
|
|||||||
/*~ class.smtp.php
|
/*~ class.smtp.php
|
||||||
.---------------------------------------------------------------------------.
|
.---------------------------------------------------------------------------.
|
||||||
| Software: PHPMailer - PHP email class |
|
| Software: PHPMailer - PHP email class |
|
||||||
| Version: 5.0.0 |
|
| Version: 5.2.2 |
|
||||||
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
|
| Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ |
|
||||||
| Info: http://phpmailer.sourceforge.net |
|
|
||||||
| Support: http://sourceforge.net/projects/phpmailer/ |
|
|
||||||
| ------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------- |
|
||||||
| Admin: Andy Prevost (project admininistrator) |
|
| Admin: Jim Jagielski (project admininistrator) |
|
||||||
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
|
| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
|
||||||
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
|
| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
|
||||||
|
| : Jim Jagielski (jimjag) jimjag@gmail.com |
|
||||||
| Founder: Brent R. Matzelle (original founder) |
|
| Founder: Brent R. Matzelle (original founder) |
|
||||||
|
| Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved. |
|
||||||
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
|
| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
|
||||||
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
||||||
| ------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------- |
|
||||||
@@ -19,11 +19,6 @@
|
|||||||
| This program is distributed in the hope that it will be useful - WITHOUT |
|
| This program is distributed in the hope that it will be useful - WITHOUT |
|
||||||
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||||
| FITNESS FOR A PARTICULAR PURPOSE. |
|
| FITNESS FOR A PARTICULAR PURPOSE. |
|
||||||
| ------------------------------------------------------------------------- |
|
|
||||||
| We offer a number of paid services (www.codeworxtech.com): |
|
|
||||||
| - Web Hosting on highly optimized fast and secure servers |
|
|
||||||
| - Technology Consulting |
|
|
||||||
| - Oursourcing (highly qualified programmers and graphic designers) |
|
|
||||||
'---------------------------------------------------------------------------'
|
'---------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -34,16 +29,18 @@
|
|||||||
* @author Andy Prevost
|
* @author Andy Prevost
|
||||||
* @author Marcus Bointon
|
* @author Marcus Bointon
|
||||||
* @copyright 2004 - 2008 Andy Prevost
|
* @copyright 2004 - 2008 Andy Prevost
|
||||||
|
* @author Jim Jagielski
|
||||||
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
|
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
|
||||||
* @version $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
|
* PHP RFC821 SMTP client
|
||||||
* commands except TURN which will always return a not implemented
|
*
|
||||||
* error. SMTP also provides some utility methods for sending mail
|
* Implements all the RFC 821 SMTP commands except TURN which will always return a not implemented error.
|
||||||
* to an SMTP server.
|
* SMTP also provides some utility methods for sending mail to an SMTP server.
|
||||||
* original author: Chris Ryan
|
* @author Chris Ryan
|
||||||
|
* @package PHPMailer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SMTP {
|
class SMTP {
|
||||||
@@ -54,7 +51,7 @@ class SMTP {
|
|||||||
public $SMTP_PORT = 25;
|
public $SMTP_PORT = 25;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP reply line ending
|
* SMTP reply line ending (don't change)
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $CRLF = "\r\n";
|
public $CRLF = "\r\n";
|
||||||
@@ -65,24 +62,70 @@ class SMTP {
|
|||||||
*/
|
*/
|
||||||
public $do_debug; // the level of debug to perform
|
public $do_debug; // the level of debug to perform
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the function/method to use for debugging output.
|
||||||
|
* Right now we only honor "echo" or "error_log"
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $Debugoutput = "echo";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets VERP use on/off (default is off)
|
* Sets VERP use on/off (default is off)
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $do_verp = false;
|
public $do_verp = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the SMTP timeout value for reads, in seconds
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $Timeout = 15;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the SMTP timelimit value for reads, in seconds
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $Timelimit = 30;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the SMTP PHPMailer Version number
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $Version = '5.2.2';
|
||||||
|
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
// PROPERTIES, PRIVATE AND PROTECTED
|
// PROPERTIES, PRIVATE AND PROTECTED
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
|
|
||||||
private $smtp_conn; // the socket to the server
|
/**
|
||||||
private $error; // error if any on the last call
|
* @var resource The socket to the server
|
||||||
private $helo_rply; // the reply the server sent to us for HELO
|
*/
|
||||||
|
private $smtp_conn;
|
||||||
|
/**
|
||||||
|
* @var string Error message, if any, for the last call
|
||||||
|
*/
|
||||||
|
private $error;
|
||||||
|
/**
|
||||||
|
* @var string The reply the server sent to us for HELO
|
||||||
|
*/
|
||||||
|
private $helo_rply;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Outputs debugging info via user-defined method
|
||||||
|
* @param string $str
|
||||||
|
*/
|
||||||
|
private function edebug($str) {
|
||||||
|
if ($this->Debugoutput == "error_log") {
|
||||||
|
error_log($str);
|
||||||
|
} else {
|
||||||
|
echo $str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the class so that the data is in a known state.
|
* Initialize the class so that the data is in a known state.
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return SMTP
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->smtp_conn = 0;
|
$this->smtp_conn = 0;
|
||||||
@@ -107,6 +150,9 @@ class SMTP {
|
|||||||
* SMTP CODE SUCCESS: 220
|
* SMTP CODE SUCCESS: 220
|
||||||
* SMTP CODE FAILURE: 421
|
* SMTP CODE FAILURE: 421
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param string $host
|
||||||
|
* @param int $port
|
||||||
|
* @param int $tval
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function Connect($host, $port = 0, $tval = 30) {
|
public function Connect($host, $port = 0, $tval = 30) {
|
||||||
@@ -136,21 +182,26 @@ class SMTP {
|
|||||||
"errno" => $errno,
|
"errno" => $errno,
|
||||||
"errstr" => $errstr);
|
"errstr" => $errstr);
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SMTP server can take longer to respond, give longer timeout for first read
|
// SMTP server can take longer to respond, give longer timeout for first read
|
||||||
// Windows does not have support for this timeout function
|
// Windows does not have support for this timeout function
|
||||||
if(substr(PHP_OS, 0, 3) != "WIN")
|
if(substr(PHP_OS, 0, 3) != "WIN") {
|
||||||
socket_set_timeout($this->smtp_conn, $tval, 0);
|
$max = ini_get('max_execution_time');
|
||||||
|
if ($max != 0 && $tval > $max) { // don't bother if unlimited
|
||||||
|
@set_time_limit($tval);
|
||||||
|
}
|
||||||
|
stream_set_timeout($this->smtp_conn, $tval, 0);
|
||||||
|
}
|
||||||
|
|
||||||
// get any announcement
|
// get any announcement
|
||||||
$announce = $this->get_lines();
|
$announce = $this->get_lines();
|
||||||
|
|
||||||
if($this->do_debug >= 2) {
|
if($this->do_debug >= 2) {
|
||||||
echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -179,7 +230,7 @@ class SMTP {
|
|||||||
$code = substr($rply,0,3);
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
if($this->do_debug >= 2) {
|
if($this->do_debug >= 2) {
|
||||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($code != 220) {
|
if($code != 220) {
|
||||||
@@ -188,7 +239,7 @@ class SMTP {
|
|||||||
"smtp_code" => $code,
|
"smtp_code" => $code,
|
||||||
"smtp_msg" => substr($rply,4));
|
"smtp_msg" => substr($rply,4));
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -205,60 +256,164 @@ class SMTP {
|
|||||||
* Performs SMTP authentication. Must be run after running the
|
* Performs SMTP authentication. Must be run after running the
|
||||||
* Hello() method. Returns true if successfully authenticated.
|
* Hello() method. Returns true if successfully authenticated.
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param string $username
|
||||||
|
* @param string $password
|
||||||
|
* @param string $authtype
|
||||||
|
* @param string $realm
|
||||||
|
* @param string $workstation
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function Authenticate($username, $password) {
|
public function Authenticate($username, $password, $authtype='LOGIN', $realm='', $workstation='') {
|
||||||
// Start authentication
|
if (empty($authtype)) {
|
||||||
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
|
$authtype = 'LOGIN';
|
||||||
|
|
||||||
$rply = $this->get_lines();
|
|
||||||
$code = substr($rply,0,3);
|
|
||||||
|
|
||||||
if($code != 334) {
|
|
||||||
$this->error =
|
|
||||||
array("error" => "AUTH not accepted from server",
|
|
||||||
"smtp_code" => $code,
|
|
||||||
"smtp_msg" => substr($rply,4));
|
|
||||||
if($this->do_debug >= 1) {
|
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send encoded username
|
switch ($authtype) {
|
||||||
fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
|
case 'PLAIN':
|
||||||
|
// Start authentication
|
||||||
|
fputs($this->smtp_conn,"AUTH PLAIN" . $this->CRLF);
|
||||||
|
|
||||||
|
$rply = $this->get_lines();
|
||||||
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
|
if($code != 334) {
|
||||||
|
$this->error =
|
||||||
|
array("error" => "AUTH not accepted from server",
|
||||||
|
"smtp_code" => $code,
|
||||||
|
"smtp_msg" => substr($rply,4));
|
||||||
|
if($this->do_debug >= 1) {
|
||||||
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// Send encoded username and password
|
||||||
|
fputs($this->smtp_conn, base64_encode("\0".$username."\0".$password) . $this->CRLF);
|
||||||
|
|
||||||
$rply = $this->get_lines();
|
$rply = $this->get_lines();
|
||||||
$code = substr($rply,0,3);
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
|
if($code != 235) {
|
||||||
|
$this->error =
|
||||||
|
array("error" => "Authentication not accepted from server",
|
||||||
|
"smtp_code" => $code,
|
||||||
|
"smtp_msg" => substr($rply,4));
|
||||||
|
if($this->do_debug >= 1) {
|
||||||
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'LOGIN':
|
||||||
|
// Start authentication
|
||||||
|
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
|
||||||
|
|
||||||
|
$rply = $this->get_lines();
|
||||||
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
|
if($code != 334) {
|
||||||
|
$this->error =
|
||||||
|
array("error" => "AUTH not accepted from server",
|
||||||
|
"smtp_code" => $code,
|
||||||
|
"smtp_msg" => substr($rply,4));
|
||||||
|
if($this->do_debug >= 1) {
|
||||||
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send encoded username
|
||||||
|
fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
|
||||||
|
|
||||||
|
$rply = $this->get_lines();
|
||||||
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
|
if($code != 334) {
|
||||||
|
$this->error =
|
||||||
|
array("error" => "Username not accepted from server",
|
||||||
|
"smtp_code" => $code,
|
||||||
|
"smtp_msg" => substr($rply,4));
|
||||||
|
if($this->do_debug >= 1) {
|
||||||
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send encoded password
|
||||||
|
fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
|
||||||
|
|
||||||
|
$rply = $this->get_lines();
|
||||||
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
|
if($code != 235) {
|
||||||
|
$this->error =
|
||||||
|
array("error" => "Password not accepted from server",
|
||||||
|
"smtp_code" => $code,
|
||||||
|
"smtp_msg" => substr($rply,4));
|
||||||
|
if($this->do_debug >= 1) {
|
||||||
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'NTLM':
|
||||||
|
/*
|
||||||
|
* ntlm_sasl_client.php
|
||||||
|
** Bundled with Permission
|
||||||
|
**
|
||||||
|
** How to telnet in windows: http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx
|
||||||
|
** PROTOCOL Documentation http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication
|
||||||
|
*/
|
||||||
|
require_once('ntlm_sasl_client.php');
|
||||||
|
$temp = new stdClass();
|
||||||
|
$ntlm_client = new ntlm_sasl_client_class;
|
||||||
|
if(! $ntlm_client->Initialize($temp)){//let's test if every function its available
|
||||||
|
$this->error = array("error" => $temp->error);
|
||||||
|
if($this->do_debug >= 1) {
|
||||||
|
$this->edebug("You need to enable some modules in your php.ini file: " . $this->error["error"] . $this->CRLF);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$msg1 = $ntlm_client->TypeMsg1($realm, $workstation);//msg1
|
||||||
|
|
||||||
|
fputs($this->smtp_conn,"AUTH NTLM " . base64_encode($msg1) . $this->CRLF);
|
||||||
|
|
||||||
if($code != 334) {
|
$rply = $this->get_lines();
|
||||||
$this->error =
|
$code = substr($rply,0,3);
|
||||||
array("error" => "Username not accepted from server",
|
|
||||||
"smtp_code" => $code,
|
|
||||||
"smtp_msg" => substr($rply,4));
|
if($code != 334) {
|
||||||
if($this->do_debug >= 1) {
|
$this->error =
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
array("error" => "AUTH not accepted from server",
|
||||||
}
|
"smtp_code" => $code,
|
||||||
return false;
|
"smtp_msg" => substr($rply,4));
|
||||||
|
if($this->do_debug >= 1) {
|
||||||
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$challange = substr($rply,3);//though 0 based, there is a white space after the 3 digit number....//msg2
|
||||||
|
$challange = base64_decode($challange);
|
||||||
|
$ntlm_res = $ntlm_client->NTLMResponse(substr($challange,24,8),$password);
|
||||||
|
$msg3 = $ntlm_client->TypeMsg3($ntlm_res,$username,$realm,$workstation);//msg3
|
||||||
|
// Send encoded username
|
||||||
|
fputs($this->smtp_conn, base64_encode($msg3) . $this->CRLF);
|
||||||
|
|
||||||
|
$rply = $this->get_lines();
|
||||||
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
|
if($code != 235) {
|
||||||
|
$this->error =
|
||||||
|
array("error" => "Could not authenticate",
|
||||||
|
"smtp_code" => $code,
|
||||||
|
"smtp_msg" => substr($rply,4));
|
||||||
|
if($this->do_debug >= 1) {
|
||||||
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send encoded password
|
|
||||||
fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
|
|
||||||
|
|
||||||
$rply = $this->get_lines();
|
|
||||||
$code = substr($rply,0,3);
|
|
||||||
|
|
||||||
if($code != 235) {
|
|
||||||
$this->error =
|
|
||||||
array("error" => "Password not accepted from server",
|
|
||||||
"smtp_code" => $code,
|
|
||||||
"smtp_msg" => substr($rply,4));
|
|
||||||
if($this->do_debug >= 1) {
|
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,7 +428,7 @@ class SMTP {
|
|||||||
if($sock_status["eof"]) {
|
if($sock_status["eof"]) {
|
||||||
// the socket is valid but we are not connected
|
// the socket is valid but we are not connected
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected";
|
$this->edebug("SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected");
|
||||||
}
|
}
|
||||||
$this->Close();
|
$this->Close();
|
||||||
return false;
|
return false;
|
||||||
@@ -321,6 +476,7 @@ class SMTP {
|
|||||||
* SMTP CODE FAILURE: 451,554
|
* SMTP CODE FAILURE: 451,554
|
||||||
* SMTP CODE ERROR : 500,501,503,421
|
* SMTP CODE ERROR : 500,501,503,421
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param string $msg_data
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function Data($msg_data) {
|
public function Data($msg_data) {
|
||||||
@@ -338,7 +494,7 @@ class SMTP {
|
|||||||
$code = substr($rply,0,3);
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
if($this->do_debug >= 2) {
|
if($this->do_debug >= 2) {
|
||||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($code != 354) {
|
if($code != 354) {
|
||||||
@@ -347,7 +503,7 @@ class SMTP {
|
|||||||
"smtp_code" => $code,
|
"smtp_code" => $code,
|
||||||
"smtp_msg" => substr($rply,4));
|
"smtp_msg" => substr($rply,4));
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -432,7 +588,7 @@ class SMTP {
|
|||||||
$code = substr($rply,0,3);
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
if($this->do_debug >= 2) {
|
if($this->do_debug >= 2) {
|
||||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($code != 250) {
|
if($code != 250) {
|
||||||
@@ -441,7 +597,7 @@ class SMTP {
|
|||||||
"smtp_code" => $code,
|
"smtp_code" => $code,
|
||||||
"smtp_msg" => substr($rply,4));
|
"smtp_msg" => substr($rply,4));
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -458,6 +614,7 @@ class SMTP {
|
|||||||
* SMTP CODE SUCCESS: 250
|
* SMTP CODE SUCCESS: 250
|
||||||
* SMTP CODE ERROR : 500, 501, 504, 421
|
* SMTP CODE ERROR : 500, 501, 504, 421
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param string $host
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function Hello($host = '') {
|
public function Hello($host = '') {
|
||||||
@@ -488,6 +645,8 @@ class SMTP {
|
|||||||
/**
|
/**
|
||||||
* Sends a HELO/EHLO command.
|
* Sends a HELO/EHLO command.
|
||||||
* @access private
|
* @access private
|
||||||
|
* @param string $hello
|
||||||
|
* @param string $host
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function SendHello($hello, $host) {
|
private function SendHello($hello, $host) {
|
||||||
@@ -497,7 +656,7 @@ class SMTP {
|
|||||||
$code = substr($rply,0,3);
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
if($this->do_debug >= 2) {
|
if($this->do_debug >= 2) {
|
||||||
echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($code != 250) {
|
if($code != 250) {
|
||||||
@@ -506,7 +665,7 @@ class SMTP {
|
|||||||
"smtp_code" => $code,
|
"smtp_code" => $code,
|
||||||
"smtp_msg" => substr($rply,4));
|
"smtp_msg" => substr($rply,4));
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -528,6 +687,7 @@ class SMTP {
|
|||||||
* SMTP CODE SUCCESS: 552,451,452
|
* SMTP CODE SUCCESS: 552,451,452
|
||||||
* SMTP CODE SUCCESS: 500,501,421
|
* SMTP CODE SUCCESS: 500,501,421
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param string $from
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function Mail($from) {
|
public function Mail($from) {
|
||||||
@@ -539,14 +699,14 @@ class SMTP {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$useVerp = ($this->do_verp ? "XVERP" : "");
|
$useVerp = ($this->do_verp ? " XVERP" : "");
|
||||||
fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
|
fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
|
||||||
|
|
||||||
$rply = $this->get_lines();
|
$rply = $this->get_lines();
|
||||||
$code = substr($rply,0,3);
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
if($this->do_debug >= 2) {
|
if($this->do_debug >= 2) {
|
||||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($code != 250) {
|
if($code != 250) {
|
||||||
@@ -555,7 +715,7 @@ class SMTP {
|
|||||||
"smtp_code" => $code,
|
"smtp_code" => $code,
|
||||||
"smtp_msg" => substr($rply,4));
|
"smtp_msg" => substr($rply,4));
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -571,6 +731,7 @@ class SMTP {
|
|||||||
* SMTP CODE SUCCESS: 221
|
* SMTP CODE SUCCESS: 221
|
||||||
* SMTP CODE ERROR : 500
|
* SMTP CODE ERROR : 500
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param bool $close_on_error
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function Quit($close_on_error = true) {
|
public function Quit($close_on_error = true) {
|
||||||
@@ -589,7 +750,7 @@ class SMTP {
|
|||||||
$byemsg = $this->get_lines();
|
$byemsg = $this->get_lines();
|
||||||
|
|
||||||
if($this->do_debug >= 2) {
|
if($this->do_debug >= 2) {
|
||||||
echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
$rval = true;
|
$rval = true;
|
||||||
@@ -603,7 +764,7 @@ class SMTP {
|
|||||||
"smtp_rply" => substr($byemsg,4));
|
"smtp_rply" => substr($byemsg,4));
|
||||||
$rval = false;
|
$rval = false;
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,6 +785,7 @@ class SMTP {
|
|||||||
* SMTP CODE FAILURE: 550,551,552,553,450,451,452
|
* SMTP CODE FAILURE: 550,551,552,553,450,451,452
|
||||||
* SMTP CODE ERROR : 500,501,503,421
|
* SMTP CODE ERROR : 500,501,503,421
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param string $to
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function Recipient($to) {
|
public function Recipient($to) {
|
||||||
@@ -641,7 +803,7 @@ class SMTP {
|
|||||||
$code = substr($rply,0,3);
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
if($this->do_debug >= 2) {
|
if($this->do_debug >= 2) {
|
||||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($code != 250 && $code != 251) {
|
if($code != 250 && $code != 251) {
|
||||||
@@ -650,7 +812,7 @@ class SMTP {
|
|||||||
"smtp_code" => $code,
|
"smtp_code" => $code,
|
||||||
"smtp_msg" => substr($rply,4));
|
"smtp_msg" => substr($rply,4));
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -684,7 +846,7 @@ class SMTP {
|
|||||||
$code = substr($rply,0,3);
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
if($this->do_debug >= 2) {
|
if($this->do_debug >= 2) {
|
||||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($code != 250) {
|
if($code != 250) {
|
||||||
@@ -693,7 +855,7 @@ class SMTP {
|
|||||||
"smtp_code" => $code,
|
"smtp_code" => $code,
|
||||||
"smtp_msg" => substr($rply,4));
|
"smtp_msg" => substr($rply,4));
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -715,6 +877,7 @@ class SMTP {
|
|||||||
* SMTP CODE SUCCESS: 552,451,452
|
* SMTP CODE SUCCESS: 552,451,452
|
||||||
* SMTP CODE SUCCESS: 500,501,502,421
|
* SMTP CODE SUCCESS: 500,501,502,421
|
||||||
* @access public
|
* @access public
|
||||||
|
* @param string $from
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function SendAndMail($from) {
|
public function SendAndMail($from) {
|
||||||
@@ -732,7 +895,7 @@ class SMTP {
|
|||||||
$code = substr($rply,0,3);
|
$code = substr($rply,0,3);
|
||||||
|
|
||||||
if($this->do_debug >= 2) {
|
if($this->do_debug >= 2) {
|
||||||
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($code != 250) {
|
if($code != 250) {
|
||||||
@@ -741,7 +904,7 @@ class SMTP {
|
|||||||
"smtp_code" => $code,
|
"smtp_code" => $code,
|
||||||
"smtp_msg" => substr($rply,4));
|
"smtp_msg" => substr($rply,4));
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -765,7 +928,7 @@ class SMTP {
|
|||||||
$this->error = array("error" => "This method, TURN, of the SMTP ".
|
$this->error = array("error" => "This method, TURN, of the SMTP ".
|
||||||
"is not implemented");
|
"is not implemented");
|
||||||
if($this->do_debug >= 1) {
|
if($this->do_debug >= 1) {
|
||||||
echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -794,21 +957,47 @@ class SMTP {
|
|||||||
*/
|
*/
|
||||||
private function get_lines() {
|
private function get_lines() {
|
||||||
$data = "";
|
$data = "";
|
||||||
while($str = @fgets($this->smtp_conn,515)) {
|
$endtime = 0;
|
||||||
|
/* If for some reason the fp is bad, don't inf loop */
|
||||||
|
if (!is_resource($this->smtp_conn)) {
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
stream_set_timeout($this->smtp_conn, $this->Timeout);
|
||||||
|
if ($this->Timelimit > 0) {
|
||||||
|
$endtime = time() + $this->Timelimit;
|
||||||
|
}
|
||||||
|
while(is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
|
||||||
|
$str = @fgets($this->smtp_conn,515);
|
||||||
if($this->do_debug >= 4) {
|
if($this->do_debug >= 4) {
|
||||||
echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />');
|
||||||
echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
$data .= $str;
|
$data .= $str;
|
||||||
if($this->do_debug >= 4) {
|
if($this->do_debug >= 4) {
|
||||||
echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />';
|
$this->edebug("SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />');
|
||||||
}
|
}
|
||||||
// if 4th character is a space, we are done reading, break the loop
|
// if 4th character is a space, we are done reading, break the loop
|
||||||
if(substr($str,3,1) == " ") { break; }
|
if(substr($str,3,1) == " ") { break; }
|
||||||
|
// Timed-out? Log and break
|
||||||
|
$info = stream_get_meta_data($this->smtp_conn);
|
||||||
|
if ($info['timed_out']) {
|
||||||
|
if($this->do_debug >= 4) {
|
||||||
|
$this->edebug("SMTP -> get_lines(): timed-out (" . $this->Timeout . " seconds) <br />");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Now check if reads took too long
|
||||||
|
if ($endtime) {
|
||||||
|
if (time() > $endtime) {
|
||||||
|
if($this->do_debug >= 4) {
|
||||||
|
$this->edebug("SMTP -> get_lines(): timelimit reached (" . $this->Timelimit . " seconds) <br />");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
?>
|
|
||||||
|
@@ -1,85 +1,85 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/help/mailout.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/help/mailout.php,v $
|
||||||
* $Revision$
|
* $Revision$
|
||||||
* $Date$
|
* $Date$
|
||||||
* $Author$
|
* $Author$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
|
||||||
$e107 = e107::getInstance();
|
$e107 = e107::getInstance();
|
||||||
$action = $e107->tp->toDB(varset($_GET['mode'],'makemail'));
|
$action = $e107->tp->toDB(varset($_GET['mode'],'makemail'));
|
||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'justone' :
|
case 'justone' :
|
||||||
$text = 'Send mail with constraints specified by an optional plugin';
|
$text = 'Send mail with constraints specified by an optional plugin';
|
||||||
break;
|
break;
|
||||||
case 'debug' :
|
case 'debug' :
|
||||||
$text = 'For devs only. Not used at present';
|
$text = 'For devs only. Not used at present';
|
||||||
break;
|
break;
|
||||||
case 'saved' :
|
case 'saved' :
|
||||||
$text = 'Select and use a saved email template to send a mailshot. Delete any template no longer required';
|
$text = 'Select and use a saved email template to send a mailshot. Delete any template no longer required';
|
||||||
break;
|
break;
|
||||||
case 'pending' :
|
case 'pending' :
|
||||||
$text = 'List of mailshots released for sending, together with current status. The mail scheduler task will process these emails as it is able, taking account of
|
$text = 'List of mailshots released for sending, together with current status. The mail scheduler task will process these emails as it is able, taking account of
|
||||||
the earliest and latest sending dates you set';
|
the earliest and latest sending dates you set';
|
||||||
break;
|
break;
|
||||||
case 'held' :
|
case 'held' :
|
||||||
$text = 'List of emails which have been prepared for sending, but not yet released';
|
$text = 'List of emails which have been prepared for sending, but not yet released';
|
||||||
break;
|
break;
|
||||||
case 'sent' :
|
case 'sent' :
|
||||||
$text = 'List of completed mailshots. Allows you to see the sending results.<br />';
|
$text = 'List of completed mailshots. Allows you to see the sending results.<br />';
|
||||||
break;
|
break;
|
||||||
case 'savedmail' :
|
case 'savedmail' :
|
||||||
case 'makemail' :
|
case 'makemail' :
|
||||||
$text = 'Create an email, give it a meaningful title, and select the list of recipients. You can save everything as a template for later, or send immediately.<br />';
|
$text = 'Create an email, give it a meaningful title, and select the list of recipients. You can save everything as a template for later, or send immediately.<br />';
|
||||||
$text .= 'Email addresses may be contributed by plugins (such as newsletter), and duplicates are removed when the mail is sent<br />';
|
$text .= 'Email addresses may be contributed by plugins (such as newsletter), and duplicates are removed when the mail is sent<br />';
|
||||||
$text .= 'Any attachment is selected from the list of valid downloads.<br />';
|
$text .= 'Any attachment is selected from the list of valid downloads.<br />';
|
||||||
$text .= 'Mail may be sent as plain text (most universal, and least at risk of being classed as spam), or as HTML (in which case a plain text alternative is automatically generated). The theme style
|
$text .= 'Mail may be sent as plain text (most universal, and least at risk of being classed as spam), or as HTML (in which case a plain text alternative is automatically generated). The theme style
|
||||||
may optionally be added to the email';
|
may optionally be added to the email. Alternatively a predefined template can be selected.';
|
||||||
break;
|
break;
|
||||||
case 'recipients' :
|
case 'recipients' :
|
||||||
$text = 'Shows all recipients or potential recipients of an email, together with current status';
|
$text = 'Shows all recipients or potential recipients of an email, together with current status';
|
||||||
break;
|
break;
|
||||||
case 'prefs' :
|
case 'prefs' :
|
||||||
$text = '<b>Configure mailshot options.</b><br />
|
$text = '<b>Configure mailshot options.</b><br />
|
||||||
A test email is sent using the current method and settings.<br /><br />';
|
A test email is sent using the current method and settings.<br /><br />';
|
||||||
$text .= '<b>Emailing Method</b><br />
|
$text .= '<b>Emailing Method</b><br />
|
||||||
Use SMTP to send mail if possible. The settings will depend on your host\'s mail server.<br /><br />';
|
Use SMTP to send mail if possible. The settings will depend on your host\'s mail server.<br /><br />';
|
||||||
$text .= '<b>Default email format</b><br />
|
$text .= '<b>Default email format</b><br />
|
||||||
Emails may be sent either in plain text only, or in HTML format. The latter generally gives a better appearance, but is more prone to being filtered by various
|
Emails may be sent either in plain text only, or in HTML format. The latter generally gives a better appearance, but is more prone to being filtered by various
|
||||||
security measures. If you select HTML, a separate plain text part is added.<br /><br />';
|
security measures. If you select HTML, a separate plain text part is added.<br /><br />';
|
||||||
$text .= '<b>Bulk mail controls</b><br />
|
$text .= '<b>Bulk mail controls</b><br />
|
||||||
The values you set here will depend on your host, and on the number of emails you send; it may be possible to set all values to zero so that the
|
The values you set here will depend on your host, and on the number of emails you send; it may be possible to set all values to zero so that the
|
||||||
mail queue is emptied virtually instantly.<br /><br />';
|
mail queue is emptied virtually instantly.<br /><br />';
|
||||||
$text .= '<b>Bounced Emails</b><br />
|
$text .= '<b>Bounced Emails</b><br />
|
||||||
You can specify an email address to receive the return response when an email is undeliverable. If you have control over your server, you can specify the
|
You can specify an email address to receive the return response when an email is undeliverable. If you have control over your server, you can specify the
|
||||||
separate scheduler-driven auto-processing script; this receives bounce messages as they arrive, and updates status instantly. Otherwise you can specify a separate email account,
|
separate scheduler-driven auto-processing script; this receives bounce messages as they arrive, and updates status instantly. Otherwise you can specify a separate email account,
|
||||||
which can be checked either periodically (using the scheduler), or manually via the user options menu. Normally this will be a standard
|
which can be checked either periodically (using the scheduler), or manually via the user options menu. Normally this will be a standard
|
||||||
POP3 account; use the TLS-related options only if specifically required by your host<br /><br />';
|
POP3 account; use the TLS-related options only if specifically required by your host<br /><br />';
|
||||||
$text .= '<b>Email Address Sources</b><br />
|
$text .= '<b>Email Address Sources</b><br />
|
||||||
If you have additional mail-related plugins, you can select which of them may contribute email addresses to the list.<br /><br />';
|
If you have additional mail-related plugins, you can select which of them may contribute email addresses to the list.<br /><br />';
|
||||||
$text .= '<b>Logging</b><br />
|
$text .= '<b>Logging</b><br />
|
||||||
The logging option creates a text file in the system log directory. This must be deleted periodically. The \'logging
|
The logging option creates a text file in the system log directory. This must be deleted periodically. The \'logging
|
||||||
only\' options allow you to see exactly who would receive emails if actually sent. The \'with errors\' option fails every
|
only\' options allow you to see exactly who would receive emails if actually sent. The \'with errors\' option fails every
|
||||||
7th email, primarily for testing';
|
7th email, primarily for testing';
|
||||||
break;
|
break;
|
||||||
case 'maint' :
|
case 'maint' :
|
||||||
$text = 'Maintenance functions for the mail database';
|
$text = 'Maintenance functions for the mail database';
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
$text = 'Undocumented option';
|
$text = 'Undocumented option';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ns -> tablerender('Mail Help', $text);
|
$ns -> tablerender('Mail Help', $text);
|
||||||
|
@@ -1,286 +1,291 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* Administration - Site Maintenance
|
* Administration - Site Maintenance
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_mailout.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_mailout.php,v $
|
||||||
* $Revision$
|
* $Revision$
|
||||||
* $Date$
|
* $Date$
|
||||||
* $Author$
|
* $Author$
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('CORE_DATE_ORDER', 'dmy'); // Temporary until we find somewhere better to put it.
|
define('CORE_DATE_ORDER', 'dmy'); // Temporary until we find somewhere better to put it.
|
||||||
// Defines order of field entry/display in date boxes
|
// Defines order of field entry/display in date boxes
|
||||||
// Acceptable values: dmy, mdy, ymd
|
// Acceptable values: dmy, mdy, ymd
|
||||||
define('LAN_MAILOUT_01','From Name');
|
define('LAN_MAILOUT_01','From Name');
|
||||||
define('LAN_MAILOUT_02','From Email');
|
define('LAN_MAILOUT_02','From Email');
|
||||||
define('LAN_MAILOUT_03','To');
|
define('LAN_MAILOUT_03','To');
|
||||||
define('LAN_MAILOUT_04','Cc');
|
define('LAN_MAILOUT_04','Cc');
|
||||||
define('LAN_MAILOUT_05','Bcc');
|
define('LAN_MAILOUT_05','Bcc');
|
||||||
define('LAN_MAILOUT_06','Subject');
|
define('LAN_MAILOUT_06','Subject');
|
||||||
define('LAN_MAILOUT_07','Attachment');
|
define('LAN_MAILOUT_07','Attachment');
|
||||||
define('LAN_MAILOUT_08','Send Email');
|
define('LAN_MAILOUT_08','Send Email');
|
||||||
define('LAN_MAILOUT_09','Send format');
|
define('LAN_MAILOUT_09','Send format');
|
||||||
define('LAN_MAILOUT_10','User Subscribed');
|
define('LAN_MAILOUT_10','User Subscribed');
|
||||||
define('LAN_MAILOUT_11','Insert Variables');
|
define('LAN_MAILOUT_11','Insert Variables');
|
||||||
define('LAN_MAILOUT_12','All Members');
|
define('LAN_MAILOUT_12','All Members');
|
||||||
define('LAN_MAILOUT_13','All Unverified Members ');
|
define('LAN_MAILOUT_13','All Unverified Members ');
|
||||||
define('LAN_MAILOUT_14','Display Name');
|
define('LAN_MAILOUT_14','Display Name');
|
||||||
define('LAN_MAILOUT_15','Mailout');
|
define('LAN_MAILOUT_15','Mailout');
|
||||||
define('LAN_MAILOUT_16','username');
|
define('LAN_MAILOUT_16','username');
|
||||||
define('LAN_MAILOUT_17','signup link');
|
define('LAN_MAILOUT_17','signup link');
|
||||||
define('LAN_MAILOUT_18','user id');
|
define('LAN_MAILOUT_18','user id');
|
||||||
define('LAN_MAILOUT_19','No target email address specified');
|
define('LAN_MAILOUT_19','No target email address specified');
|
||||||
define('LAN_MAILOUT_20','Sendmail-path');
|
define('LAN_MAILOUT_20','Sendmail-path');
|
||||||
define('LAN_MAILOUT_21','Bulk mailing Entries');
|
define('LAN_MAILOUT_21','Bulk mailing Entries');
|
||||||
define('LAN_MAILOUT_22','There are currently no saved entries');
|
define('LAN_MAILOUT_22','There are currently no saved entries');
|
||||||
define('LAN_MAILOUT_23','userclass: ');
|
define('LAN_MAILOUT_23','userclass: ');
|
||||||
define('LAN_MAILOUT_24','email(s) are ready to be sent');
|
define('LAN_MAILOUT_24','email(s) are ready to be sent');
|
||||||
define('LAN_MAILOUT_25','Bulk mailing controls');
|
define('LAN_MAILOUT_25','Bulk mailing controls');
|
||||||
define('LAN_MAILOUT_26', 'Pause bulk mailing every');
|
define('LAN_MAILOUT_26', 'Pause bulk mailing every');
|
||||||
define('LAN_MAILOUT_27', 'emails for ');
|
define('LAN_MAILOUT_27', 'emails for ');
|
||||||
define('LAN_MAILOUT_28', 'Save Changes');
|
define('LAN_MAILOUT_28', 'Save Changes');
|
||||||
define('LAN_MAILOUT_29', 'seconds');
|
define('LAN_MAILOUT_29', 'seconds');
|
||||||
define('LAN_MAILOUT_30', 'Used mostly with SMTP keepalive. A pause of more than 30 seconds may cause the browser to time-out');
|
define('LAN_MAILOUT_30', 'Used mostly with SMTP keepalive. A pause of more than 30 seconds may cause the browser to time-out');
|
||||||
define('LAN_MAILOUT_31', 'Bounced Email Processing');
|
define('LAN_MAILOUT_31', 'Bounced Email Processing');
|
||||||
define('LAN_MAILOUT_32', 'Email address');
|
define('LAN_MAILOUT_32', 'Email address');
|
||||||
define('LAN_MAILOUT_33', 'Incoming Mail server');
|
define('LAN_MAILOUT_33', 'Incoming Mail server');
|
||||||
define('LAN_MAILOUT_34', 'Account (user) Name');
|
define('LAN_MAILOUT_34', 'Account (user) Name');
|
||||||
define('LAN_MAILOUT_35', 'Password');
|
define('LAN_MAILOUT_35', 'Password');
|
||||||
define('LAN_MAILOUT_36', 'Delete Bounced Mails after checking');
|
define('LAN_MAILOUT_36', 'Delete Bounced Mails after checking');
|
||||||
define('LAN_MAILOUT_37', 'Proceed');
|
define('LAN_MAILOUT_37', 'Proceed');
|
||||||
define('LAN_MAILOUT_38', 'Cancel');
|
define('LAN_MAILOUT_38', 'Cancel');
|
||||||
define('LAN_MAILOUT_39', 'Emailing');
|
define('LAN_MAILOUT_39', 'Emailing');
|
||||||
define('LAN_MAILOUT_40', 'You need to rename <b>e107.htaccess</b> to <b>.htaccess</b> in');
|
define('LAN_MAILOUT_40', 'You need to rename <b>e107.htaccess</b> to <b>.htaccess</b> in');
|
||||||
define('LAN_MAILOUT_41', 'before sending mail from this page.');
|
define('LAN_MAILOUT_41', 'before sending mail from this page.');
|
||||||
define('LAN_MAILOUT_42', 'Warning');
|
define('LAN_MAILOUT_42', 'Warning');
|
||||||
define('LAN_MAILOUT_43', 'Username');
|
define('LAN_MAILOUT_43', 'Username');
|
||||||
define('LAN_MAILOUT_44', 'User Login');
|
define('LAN_MAILOUT_44', 'User Login');
|
||||||
define('LAN_MAILOUT_45', 'User Email');
|
define('LAN_MAILOUT_45', 'User Email');
|
||||||
define('LAN_MAILOUT_46', 'User-Match');
|
define('LAN_MAILOUT_46', 'User-Match');
|
||||||
define('LAN_MAILOUT_47', 'contains');
|
define('LAN_MAILOUT_47', 'contains');
|
||||||
define('LAN_MAILOUT_48', 'equals');
|
define('LAN_MAILOUT_48', 'equals');
|
||||||
define('LAN_MAILOUT_49', 'Id');
|
define('LAN_MAILOUT_49', 'Id');
|
||||||
define('LAN_MAILOUT_50', 'Author');
|
define('LAN_MAILOUT_50', 'Author');
|
||||||
define('LAN_MAILOUT_51', 'Subject');
|
define('LAN_MAILOUT_51', 'Subject');
|
||||||
define('LAN_MAILOUT_52', 'Last mod');
|
define('LAN_MAILOUT_52', 'Last mod');
|
||||||
define('LAN_MAILOUT_53', 'Admins');
|
define('LAN_MAILOUT_53', 'Admins');
|
||||||
define('LAN_MAILOUT_54', 'Self');
|
define('LAN_MAILOUT_54', 'Self');
|
||||||
define('LAN_MAILOUT_55', 'Userclass');
|
define('LAN_MAILOUT_55', 'Userclass');
|
||||||
define('LAN_MAILOUT_56', 'Last Visit (dd-mm-yy)');
|
define('LAN_MAILOUT_56', 'Last Visit (dd-mm-yy)');
|
||||||
define('LAN_MAILOUT_57', 'Send bulk SMTP emails in blocks'); // SMTP KeepAlive option
|
define('LAN_MAILOUT_57', 'Send bulk SMTP emails in blocks'); // SMTP KeepAlive option
|
||||||
//define('LAN_MAILOUT_58', 'There is a problem with the attachment:');
|
//define('LAN_MAILOUT_58', 'There is a problem with the attachment:');
|
||||||
//define('LAN_MAILOUT_59', 'Mailing Progress');
|
//define('LAN_MAILOUT_59', 'Mailing Progress');
|
||||||
//define('LAN_MAILOUT_60', 'Sending...');
|
//define('LAN_MAILOUT_60', 'Sending...');
|
||||||
//define('LAN_MAILOUT_61', 'There are no remaining emails to be sent.');
|
//define('LAN_MAILOUT_61', 'There are no remaining emails to be sent.');
|
||||||
//define('LAN_MAILOUT_62', 'Emails sent:');
|
//define('LAN_MAILOUT_62', 'Emails sent:');
|
||||||
//define('LAN_MAILOUT_63', 'Emails failed:');
|
//define('LAN_MAILOUT_63', 'Emails failed:');
|
||||||
//define('LAN_MAILOUT_64', 'Total time elapsed:');
|
//define('LAN_MAILOUT_64', 'Total time elapsed:');
|
||||||
//define('LAN_MAILOUT_65', 'seconds');
|
//define('LAN_MAILOUT_65', 'seconds');
|
||||||
//define('LAN_MAILOUT_66', 'Cancelled Successfully');
|
//define('LAN_MAILOUT_66', 'Cancelled Successfully');
|
||||||
define('LAN_MAILOUT_67', 'The email could not be sent. Please review your SMTP settings, or select another mailing method and try again.');
|
define('LAN_MAILOUT_67', 'The email could not be sent. Please review your SMTP settings, or select another mailing method and try again.');
|
||||||
define('LAN_MAILOUT_68','Registered Users');
|
define('LAN_MAILOUT_68','Registered Users');
|
||||||
define('LAN_MAILOUT_69','matches, after ');
|
define('LAN_MAILOUT_69','matches, after ');
|
||||||
define('LAN_MAILOUT_70',' duplicates stripped.');
|
define('LAN_MAILOUT_70',' duplicates stripped.');
|
||||||
define('LAN_MAILOUT_71','Total emails to send');
|
define('LAN_MAILOUT_71','Total emails to send');
|
||||||
define('LAN_MAILOUT_72','Mailshot logging');
|
define('LAN_MAILOUT_72','Mailshot logging');
|
||||||
define('LAN_MAILOUT_73','No logging');
|
define('LAN_MAILOUT_73','No logging');
|
||||||
define('LAN_MAILOUT_74','Logging only (no send)');
|
define('LAN_MAILOUT_74','Logging only (no send)');
|
||||||
define('LAN_MAILOUT_75','Log and send');
|
define('LAN_MAILOUT_75','Log and send');
|
||||||
define('LAN_MAILOUT_76','Include email info in log');
|
define('LAN_MAILOUT_76','Include email info in log');
|
||||||
define('LAN_MAILOUT_77','Supplementary email address sources');
|
define('LAN_MAILOUT_77','Supplementary email address sources');
|
||||||
define('LAN_MAILOUT_78','Mailshot Status');
|
define('LAN_MAILOUT_78','Mailshot Status');
|
||||||
define('LAN_MAILOUT_79','No mailshots to display');
|
define('LAN_MAILOUT_79','No mailshots to display');
|
||||||
define('LAN_MAILOUT_80','Date');
|
define('LAN_MAILOUT_80','Date');
|
||||||
define('LAN_MAILOUT_81','The email has been successfully sent, please check your inbox.');
|
define('LAN_MAILOUT_81','The email has been successfully sent, please check your inbox.');
|
||||||
define('LAN_MAILOUT_82','Mails sent');
|
define('LAN_MAILOUT_82','Mails sent');
|
||||||
define('LAN_MAILOUT_83','Mails to go');
|
define('LAN_MAILOUT_83','Mails to go');
|
||||||
define('LAN_MAILOUT_84','Mail ID');
|
define('LAN_MAILOUT_84','Mail ID');
|
||||||
define('LAN_MAILOUT_85','Originator');
|
define('LAN_MAILOUT_85','Originator');
|
||||||
define('LAN_MAILOUT_86','Re-send');
|
define('LAN_MAILOUT_86','Re-send');
|
||||||
define('LAN_MAILOUT_87','SMTP Server');
|
define('LAN_MAILOUT_87','SMTP Server');
|
||||||
define('LAN_MAILOUT_88','SMTP Username');
|
define('LAN_MAILOUT_88','SMTP Username');
|
||||||
define('LAN_MAILOUT_89','SMTP Password');
|
define('LAN_MAILOUT_89','SMTP Password');
|
||||||
define('LAN_MAILOUT_90','SMTP Features');
|
define('LAN_MAILOUT_90','SMTP Features');
|
||||||
define('LAN_MAILOUT_91','POP before SMTP');
|
define('LAN_MAILOUT_91','POP before SMTP');
|
||||||
define('LAN_MAILOUT_92','SSL');
|
define('LAN_MAILOUT_92','SSL');
|
||||||
define('LAN_MAILOUT_93','TLS');
|
define('LAN_MAILOUT_93','TLS');
|
||||||
define('LAN_MAILOUT_94','(Use SSL for gmail/googlemail)');
|
define('LAN_MAILOUT_94','(Use SSL for gmail/googlemail)');
|
||||||
define('LAN_MAILOUT_95','Use VERP for bulk mailing');
|
define('LAN_MAILOUT_95','Use VERP for bulk mailing');
|
||||||
define('LAN_MAILOUT_96','none');
|
define('LAN_MAILOUT_96','none');
|
||||||
define('LAN_MAILOUT_97','Mailer Results');
|
define('LAN_MAILOUT_97','Mailer Results');
|
||||||
define('LAN_MAILOUT_98','Orphaned entries');
|
define('LAN_MAILOUT_98','Orphaned entries');
|
||||||
define('LAN_MAILOUT_99','Confirm retry mailshot');
|
define('LAN_MAILOUT_99','Confirm retry mailshot');
|
||||||
define('LAN_MAILOUT_100','Message');
|
define('LAN_MAILOUT_100','Message');
|
||||||
define('LAN_MAILOUT_101','Email Detail');
|
define('LAN_MAILOUT_101','Email Detail');
|
||||||
define('LAN_MAILOUT_102','Detail of mailshot');
|
define('LAN_MAILOUT_102','Detail of mailshot');
|
||||||
define('LAN_MAILOUT_103','Results of attempts to send');
|
define('LAN_MAILOUT_103','Results of attempts to send');
|
||||||
define('LAN_MAILOUT_104','No attempt to send, or error saving result');
|
define('LAN_MAILOUT_104','No attempt to send, or error saving result');
|
||||||
define('LAN_MAILOUT_105','Details of up to 10 failures');
|
define('LAN_MAILOUT_105','Details of up to 10 failures');
|
||||||
define('LAN_MAILOUT_106','The email could not be sent. It appears that your server is not correctly configured to send emails, please try again using SMTP, or contact your hosts and ask them to check their sendmail / email server settings.');
|
define('LAN_MAILOUT_106','The email could not be sent. It appears that your server is not correctly configured to send emails, please try again using SMTP, or contact your hosts and ask them to check their sendmail / email server settings.');
|
||||||
define('LAN_MAILOUT_107','at');
|
define('LAN_MAILOUT_107','at');
|
||||||
define('LAN_MAILOUT_108','Result');
|
define('LAN_MAILOUT_108','Result');
|
||||||
define('LAN_MAILOUT_109','Show detail');
|
define('LAN_MAILOUT_109','Show detail');
|
||||||
define('LAN_MAILOUT_110','Send test email');
|
define('LAN_MAILOUT_110','Send test email');
|
||||||
define('LAN_MAILOUT_111','Email Title (not sent)');
|
define('LAN_MAILOUT_111','Email Title (not sent)');
|
||||||
define('LAN_MAILOUT_112','Click to send email to');
|
define('LAN_MAILOUT_112','Click to send email to');
|
||||||
define('LAN_MAILOUT_113','Test email from');
|
define('LAN_MAILOUT_113','Test email from');
|
||||||
define('LAN_MAILOUT_114',"This is a test email, it appears that your email settings are working ok!\n\nRegards\nfrom the e107 website system.");
|
define('LAN_MAILOUT_114',"This is a test email, it appears that your email settings are working ok!\n\nRegards\nfrom the e107 website system.");
|
||||||
define('LAN_MAILOUT_115','Emailing method');
|
define('LAN_MAILOUT_115','Emailing method');
|
||||||
define('LAN_MAILOUT_116','If unsure, leave as php');
|
define('LAN_MAILOUT_116','If unsure, leave as php');
|
||||||
define('LAN_MAILOUT_117','complete');
|
define('LAN_MAILOUT_117','complete');
|
||||||
define('LAN_MAILOUT_118','Click on \'proceed\' to start sending emails. Click on \'cancel\' to stop the run. Once complete, select another page. Unsent emails cal be viewed through the \'Mailshot status\' screen');
|
define('LAN_MAILOUT_118','Click on \'proceed\' to start sending emails. Click on \'cancel\' to stop the run. Once complete, select another page. Unsent emails cal be viewed through the \'Mailshot status\' screen');
|
||||||
define('LAN_MAILOUT_119','Logging only, with errors');
|
define('LAN_MAILOUT_119','Logging only, with errors');
|
||||||
define('LAN_MAILOUT_120','Account type');
|
define('LAN_MAILOUT_120','Account type');
|
||||||
define('LAN_MAILOUT_121','Standard POP3');
|
define('LAN_MAILOUT_121','Standard POP3');
|
||||||
define('LAN_MAILOUT_122','POP3, TLS disabled');
|
define('LAN_MAILOUT_122','POP3, TLS disabled');
|
||||||
define('LAN_MAILOUT_123','POP3 with TLS');
|
define('LAN_MAILOUT_123','POP3 with TLS');
|
||||||
define('LAN_MAILOUT_124','IMAP');
|
define('LAN_MAILOUT_124','IMAP');
|
||||||
define('LAN_MAILOUT_125', 'Text only');
|
define('LAN_MAILOUT_125', 'Text only');
|
||||||
define('LAN_MAILOUT_126', 'Text and HTML');
|
define('LAN_MAILOUT_126', 'Text and HTML');
|
||||||
define('LAN_MAILOUT_127', 'Include theme');
|
define('LAN_MAILOUT_127', 'Include theme');
|
||||||
define('LAN_MAILOUT_128', 'Send Error');
|
define('LAN_MAILOUT_128', 'Send Error');
|
||||||
define('LAN_MAILOUT_129', 'Expiry Date');
|
define('LAN_MAILOUT_129', 'Expiry Date');
|
||||||
define('LAN_MAILOUT_130', 'Creation Date');
|
define('LAN_MAILOUT_130', 'Creation Date');
|
||||||
define('LAN_MAILOUT_131', 'Sending Started');
|
define('LAN_MAILOUT_131', 'Sending Started');
|
||||||
define('LAN_MAILOUT_132', 'Sending Complete');
|
define('LAN_MAILOUT_132', 'Sending Complete');
|
||||||
define('LAN_MAILOUT_133', 'Source');
|
define('LAN_MAILOUT_133', 'Source');
|
||||||
define('LAN_MAILOUT_134', 'Priority');
|
define('LAN_MAILOUT_134', 'Priority');
|
||||||
define('LAN_MAILOUT_135', 'Title');
|
define('LAN_MAILOUT_135', 'Title');
|
||||||
define('LAN_MAILOUT_136', 'Mailout Status');
|
define('LAN_MAILOUT_136', 'Mailout Status');
|
||||||
define('LAN_MAILOUT_137', 'Mail Ref');
|
define('LAN_MAILOUT_137', 'Mail Ref');
|
||||||
define('LAN_MAILOUT_138', 'Email status');
|
define('LAN_MAILOUT_138', 'Email status');
|
||||||
define('LAN_MAILOUT_139', 'Date active');
|
define('LAN_MAILOUT_139', 'Date active');
|
||||||
define('LAN_MAILOUT_140', 'Recipient Email');
|
define('LAN_MAILOUT_140', 'Recipient Email');
|
||||||
define('LAN_MAILOUT_141', 'Recipient Name');
|
define('LAN_MAILOUT_141', 'Recipient Name');
|
||||||
define('LAN_MAILOUT_142', 'Recipient User ID');
|
define('LAN_MAILOUT_142', 'Recipient User ID');
|
||||||
define('LAN_MAILOUT_143', 'Email ref.');
|
define('LAN_MAILOUT_143', 'Email ref.');
|
||||||
define('LAN_MAILOUT_144', 'Bounced');
|
define('LAN_MAILOUT_144', 'Bounced');
|
||||||
define('LAN_MAILOUT_145', 'New email saved');
|
define('LAN_MAILOUT_145', 'New email saved');
|
||||||
define('LAN_MAILOUT_146', 'Error saving email');
|
define('LAN_MAILOUT_146', 'Error saving email');
|
||||||
define('LAN_MAILOUT_147', 'Email updated');
|
define('LAN_MAILOUT_147', 'Email updated');
|
||||||
define('LAN_MAILOUT_148', 'User values');
|
define('LAN_MAILOUT_148', 'User values');
|
||||||
define('LAN_MAILOUT_149', 'Sender Email');
|
define('LAN_MAILOUT_149', 'Sender Email');
|
||||||
define('LAN_MAILOUT_150', 'Sender Name');
|
define('LAN_MAILOUT_150', 'Sender Name');
|
||||||
define('LAN_MAILOUT_151', 'Copy to');
|
define('LAN_MAILOUT_151', 'Copy to');
|
||||||
define('LAN_MAILOUT_152', 'Blind copy to');
|
define('LAN_MAILOUT_152', 'Blind copy to');
|
||||||
define('LAN_MAILOUT_153', 'Attachments');
|
define('LAN_MAILOUT_153', 'Attachments');
|
||||||
define('LAN_MAILOUT_154', 'Send Format');
|
define('LAN_MAILOUT_154', 'Send Format');
|
||||||
define('LAN_MAILOUT_155', 'Selectors');
|
define('LAN_MAILOUT_155', 'Selectors');
|
||||||
define('LAN_MAILOUT_156', 'Maximum number of emails to send per scheduler tick');
|
define('LAN_MAILOUT_156', 'Maximum number of emails to send per scheduler tick');
|
||||||
define('LAN_MAILOUT_157', 'Value will depend on a number of factors, including how often your mail queue scheduler job is triggered and the rate at which your ISP will accept outgoing mail. Zero to clear queue each time');
|
define('LAN_MAILOUT_157', 'Value will depend on a number of factors, including how often your mail queue scheduler job is triggered and the rate at which your ISP will accept outgoing mail. Zero to clear queue each time');
|
||||||
define('LAN_MAILOUT_158', 'Send now');
|
define('LAN_MAILOUT_158', 'Send now');
|
||||||
define('LAN_MAILOUT_159', 'Hold email');
|
define('LAN_MAILOUT_159', 'Hold email');
|
||||||
define('LAN_MAILOUT_160', 'Cancel send');
|
define('LAN_MAILOUT_160', 'Cancel send');
|
||||||
define('LAN_MAILOUT_161', 'IMPORTANT! This file appears to not exist');
|
define('LAN_MAILOUT_161', 'IMPORTANT! This file appears to not exist');
|
||||||
define('LAN_MAILOUT_162', 'IMPORTANT! You need to make this file executable');
|
define('LAN_MAILOUT_162', 'IMPORTANT! You need to make this file executable');
|
||||||
define('LAN_MAILOUT_163', 'Edit/Send Mail');
|
define('LAN_MAILOUT_163', 'Edit/Send Mail');
|
||||||
define('LAN_MAILOUT_164', 'Email information not found');
|
define('LAN_MAILOUT_164', 'Email information not found');
|
||||||
define('LAN_MAILOUT_165', 'Confirm delete the following stored email, including any recipient records');
|
define('LAN_MAILOUT_165', 'Confirm delete the following stored email, including any recipient records');
|
||||||
define('LAN_MAILOUT_166', 'General error deleting mail ref: --ID--');
|
define('LAN_MAILOUT_166', 'General error deleting mail ref: --ID--');
|
||||||
define('LAN_MAILOUT_167', 'Error deleting mail content ref: --ID--');
|
define('LAN_MAILOUT_167', 'Error deleting mail content ref: --ID--');
|
||||||
define('LAN_MAILOUT_168', 'Mail content deleted ref: --ID--');
|
define('LAN_MAILOUT_168', 'Mail content deleted ref: --ID--');
|
||||||
define('LAN_MAILOUT_169', 'Error deleting mail recipients ref: --ID--');
|
define('LAN_MAILOUT_169', 'Error deleting mail recipients ref: --ID--');
|
||||||
define('LAN_MAILOUT_170', 'Deleted --NUM-- recipients for mail ref: --ID--');
|
define('LAN_MAILOUT_170', 'Deleted --NUM-- recipients for mail ref: --ID--');
|
||||||
define('LAN_MAILOUT_171', 'Confirm email delete');
|
define('LAN_MAILOUT_171', 'Confirm email delete');
|
||||||
define('LAN_MAILOUT_172', 'Mail Type/Status');
|
define('LAN_MAILOUT_172', 'Mail Type/Status');
|
||||||
define('LAN_MAILOUT_173', 'Recipients');
|
define('LAN_MAILOUT_173', 'Recipients');
|
||||||
define('LAN_MAILOUT_174', 'Security check fail: --ID-- --CHECK--');
|
define('LAN_MAILOUT_174', 'Security check fail: --ID-- --CHECK--');
|
||||||
define('LAN_MAILOUT_175', 'Before');
|
define('LAN_MAILOUT_175', 'Before');
|
||||||
define('LAN_MAILOUT_176', 'Equal to');
|
define('LAN_MAILOUT_176', 'Equal to');
|
||||||
define('LAN_MAILOUT_177', 'After');
|
define('LAN_MAILOUT_177', 'After');
|
||||||
define('LAN_MAILOUT_178', 'Last site visit');
|
define('LAN_MAILOUT_178', 'Last site visit');
|
||||||
define('LAN_MAILOUT_179', 'Confirm email send');
|
define('LAN_MAILOUT_179', 'Confirm email send');
|
||||||
define('LAN_MAILOUT_180', 'Selection criteria:');
|
define('LAN_MAILOUT_180', 'Selection criteria:');
|
||||||
define('LAN_MAILOUT_181', 'Show recipients');
|
define('LAN_MAILOUT_181', 'Show recipients');
|
||||||
define('LAN_MAILOUT_182', 'Tidy database tables');
|
define('LAN_MAILOUT_182', 'Tidy database tables');
|
||||||
define('LAN_MAILOUT_183', 'Error tidying database');
|
define('LAN_MAILOUT_183', 'Error tidying database');
|
||||||
define('LAN_MAILOUT_184', 'Database tidied');
|
define('LAN_MAILOUT_184', 'Database tidied');
|
||||||
define('LAN_MAILOUT_185', 'Emails added to send queue');
|
define('LAN_MAILOUT_185', 'Emails added to send queue');
|
||||||
define('LAN_MAILOUT_186', 'General error putting mail ref: --ID-- on hold');
|
define('LAN_MAILOUT_186', 'General error putting mail ref: --ID-- on hold');
|
||||||
define('LAN_MAILOUT_187', 'Email --ID-- put on hold');
|
define('LAN_MAILOUT_187', 'Email --ID-- put on hold');
|
||||||
define('LAN_MAILOUT_188', 'General error sending mail ref: --ID--');
|
define('LAN_MAILOUT_188', 'General error sending mail ref: --ID--');
|
||||||
define('LAN_MAILOUT_189', 'Test address');
|
define('LAN_MAILOUT_189', 'Test address');
|
||||||
|
|
||||||
// Admin menu text
|
// Admin menu text
|
||||||
define('LAN_MAILOUT_190', 'Create/Send Mail');
|
define('LAN_MAILOUT_190', 'Create/Send Mail');
|
||||||
define('LAN_MAILOUT_191', 'Saved emails');
|
define('LAN_MAILOUT_191', 'Saved emails');
|
||||||
define('LAN_MAILOUT_192', 'Completed Mailshots');
|
define('LAN_MAILOUT_192', 'Completed Mailshots');
|
||||||
define('LAN_MAILOUT_193', 'Pending Mailshots');
|
define('LAN_MAILOUT_193', 'Pending Mailshots');
|
||||||
define('LAN_MAILOUT_194', 'Held Mailshots');
|
define('LAN_MAILOUT_194', 'Held Mailshots');
|
||||||
define('LAN_MAILOUT_195', '');
|
define('LAN_MAILOUT_195', '');
|
||||||
define('LAN_MAILOUT_196', '');
|
define('LAN_MAILOUT_196', '');
|
||||||
|
|
||||||
// Block of error messages kept together
|
// Block of error messages kept together
|
||||||
define('LAN_MAILOUT_200', 'No subject specified');
|
define('LAN_MAILOUT_200', 'No subject specified');
|
||||||
define('LAN_MAILOUT_201', 'No meaningful data for email');
|
define('LAN_MAILOUT_201', 'No meaningful data for email');
|
||||||
define('LAN_MAILOUT_202', 'No text in email body');
|
define('LAN_MAILOUT_202', 'No text in email body');
|
||||||
define('LAN_MAILOUT_203', 'No sender name specified');
|
define('LAN_MAILOUT_203', 'No sender name specified');
|
||||||
define('LAN_MAILOUT_204', 'No sender email address specified');
|
define('LAN_MAILOUT_204', 'No sender email address specified');
|
||||||
define('LAN_MAILOUT_205', 'Email send format error');
|
define('LAN_MAILOUT_205', 'Email send format error');
|
||||||
define('LAN_MAILOUT_206', 'Invalid mail ID (--ID--) specified');
|
define('LAN_MAILOUT_206', 'Invalid mail ID (--ID--) specified');
|
||||||
define('LAN_MAILOUT_207', '');
|
define('LAN_MAILOUT_207', 'Template load error');
|
||||||
define('LAN_MAILOUT_208', '');
|
define('LAN_MAILOUT_208', 'Template conversion error');
|
||||||
define('LAN_MAILOUT_209', '');
|
define('LAN_MAILOUT_209', '');
|
||||||
define('LAN_MAILOUT_210', '');
|
define('LAN_MAILOUT_210', '');
|
||||||
|
|
||||||
// Block of status messages kept together
|
// Block of status messages kept together
|
||||||
define('LAN_MAILOUT_211', 'Sent');
|
define('LAN_MAILOUT_211', 'Sent');
|
||||||
define('LAN_MAILOUT_212', 'Failed');
|
define('LAN_MAILOUT_212', 'Failed');
|
||||||
define('LAN_MAILOUT_213', 'Bounced');
|
define('LAN_MAILOUT_213', 'Bounced');
|
||||||
define('LAN_MAILOUT_214', 'To send');
|
define('LAN_MAILOUT_214', 'To send');
|
||||||
define('LAN_MAILOUT_215', 'Saved');
|
define('LAN_MAILOUT_215', 'Saved');
|
||||||
define('LAN_MAILOUT_216', 'Code error');
|
define('LAN_MAILOUT_216', 'Code error');
|
||||||
define('LAN_MAILOUT_217', 'Held');
|
define('LAN_MAILOUT_217', 'Held');
|
||||||
define('LAN_MAILOUT_218', 'Cancelled');
|
define('LAN_MAILOUT_218', 'Cancelled');
|
||||||
define('LAN_MAILOUT_219', 'Partial');
|
define('LAN_MAILOUT_219', 'Partial');
|
||||||
|
|
||||||
// General messages continued
|
// General messages continued
|
||||||
define('LAN_MAILOUT_220', 'Email ID --ID-- cancelled');
|
define('LAN_MAILOUT_220', 'Email ID --ID-- cancelled');
|
||||||
define('LAN_MAILOUT_221', 'Error cancelling email with ID --ID--');
|
define('LAN_MAILOUT_221', 'Error cancelling email with ID --ID--');
|
||||||
define('LAN_MAILOUT_222', 'Default email format');
|
define('LAN_MAILOUT_222', 'Default email format');
|
||||||
define('LAN_MAILOUT_223', '(Used for some non-bulk emails)');
|
define('LAN_MAILOUT_223', '(Used for some system-generated emails)');
|
||||||
define('LAN_MAILOUT_224', 'Inc. Images');
|
define('LAN_MAILOUT_224', 'Inc. Images');
|
||||||
define('LAN_MAILOUT_225', 'Include images in email');
|
define('LAN_MAILOUT_225', 'Include images in email');
|
||||||
define('LAN_MAILOUT_226', '--COUNT-- orphaned recipient record(s) removed');
|
define('LAN_MAILOUT_226', '--COUNT-- orphaned recipient record(s) removed');
|
||||||
define('LAN_MAILOUT_227', 'Deleted --COUNT-- records from --TABLE--');
|
define('LAN_MAILOUT_227', 'Deleted --COUNT-- records from --TABLE--');
|
||||||
define('LAN_MAILOUT_228', '--COUNT-- anomalies in mail_content corrected; records: --RECORDS--');
|
define('LAN_MAILOUT_228', '--COUNT-- anomalies in mail_content corrected; records: --RECORDS--');
|
||||||
define('LAN_MAILOUT_229', 'Email ID --ID-- put on hold');
|
define('LAN_MAILOUT_229', 'Email ID --ID-- put on hold');
|
||||||
define('LAN_MAILOUT_230', 'Error holding email with ID --ID--');
|
define('LAN_MAILOUT_230', 'Error holding email with ID --ID--');
|
||||||
define('LAN_MAILOUT_231', 'Processing method');
|
define('LAN_MAILOUT_231', 'Bounced emails - Processing method');
|
||||||
define('LAN_MAILOUT_232', 'None');
|
define('LAN_MAILOUT_232', 'None');
|
||||||
define('LAN_MAILOUT_233', 'Auto-process script');
|
define('LAN_MAILOUT_233', 'Auto-process script');
|
||||||
define('LAN_MAILOUT_234', 'Mail account');
|
define('LAN_MAILOUT_234', 'Mail account');
|
||||||
define('LAN_MAILOUT_235', '(Your server has to be configured to use this script)');
|
define('LAN_MAILOUT_235', '(Your server has to be configured to use this script)');
|
||||||
define('LAN_MAILOUT_236', 'Last Bounce Processed');
|
define('LAN_MAILOUT_236', 'Last Bounce Processed');
|
||||||
define('LAN_MAILOUT_237', 'Summary counters updated on --COUNT-- emails');
|
define('LAN_MAILOUT_237', 'Summary counters updated on --COUNT-- emails');
|
||||||
define('LAN_MAILOUT_238', 'Earliest time to send');
|
define('LAN_MAILOUT_238', 'Earliest time to send');
|
||||||
define('LAN_MAILOUT_239', 'Latest time to send');
|
define('LAN_MAILOUT_239', 'Latest time to send');
|
||||||
define('LAN_MAILOUT_240', 'Notify me when run complete');
|
define('LAN_MAILOUT_240', 'Notify me when run complete');
|
||||||
define('LAN_MAILOUT_241', ' (This is in addition to the standard e107 notify options)');
|
define('LAN_MAILOUT_241', ' (This is in addition to the standard e107 notify options)');
|
||||||
define('LAN_MAILOUT_242', 'Additional options (only when sending)');
|
define('LAN_MAILOUT_242', 'Additional options (only when sending)');
|
||||||
define('LAN_MAILOUT_243', 'Notify');
|
define('LAN_MAILOUT_243', 'Notify');
|
||||||
define('LAN_MAILOUT_244', 'Email sent: ');
|
define('LAN_MAILOUT_244', 'Email sent: ');
|
||||||
define('LAN_MAILOUT_245', 'Check for bounces automatically');
|
define('LAN_MAILOUT_245', 'Check for bounces automatically');
|
||||||
define('LAN_MAILOUT_246', 'If checked, you will need to activate the task in the scheduler');
|
define('LAN_MAILOUT_246', 'If checked, you will need to activate the task in the scheduler');
|
||||||
define('LAN_MAILOUT_247', 'Email information:');
|
define('LAN_MAILOUT_247', 'Email information:');
|
||||||
define('LAN_MAILOUT_248', 'Completion status: ');
|
define('LAN_MAILOUT_248', 'Completion status: ');
|
||||||
define('LAN_MAILOUT_249', 'Send results:');
|
define('LAN_MAILOUT_249', 'Send results:');
|
||||||
define('LAN_MAILOUT_250', '--- End of notification ---');
|
define('LAN_MAILOUT_250', '--- End of notification ---');
|
||||||
define('LAN_MAILOUT_251', 'Copy and edit');
|
define('LAN_MAILOUT_251', 'Copy and edit');
|
||||||
define('LAN_MAILOUT_252', 'Does various consistency checks on the data, corrects counts, deletes temporary data');
|
define('LAN_MAILOUT_252', 'Does various consistency checks on the data, corrects counts, deletes temporary data');
|
||||||
define('LAN_MAILOUT_253', 'No recipients found - check for database corruption');
|
define('LAN_MAILOUT_253', 'No recipients found - check for database corruption');
|
||||||
define('LAN_MAILOUT_254', '');
|
define('LAN_MAILOUT_254', 'View templated email');
|
||||||
|
define('LAN_MAILOUT_255', 'Templated Email, ID: ');
|
||||||
|
define('LAN_MAILOUT_256', 'Return');
|
||||||
define('LAN_SEND', 'Send');
|
define('LAN_MAILOUT_257', 'Generated template');
|
||||||
define('LAN_HOLD', 'Hold');
|
define('LAN_MAILOUT_258', 'Template: ');
|
||||||
define('LAN_SUBMIT', 'Do it!');
|
define('LAN_MAILOUT_259', '');
|
||||||
|
|
||||||
|
|
||||||
|
define('LAN_SEND', 'Send');
|
||||||
|
define('LAN_HOLD', 'Hold');
|
||||||
|
define('LAN_SUBMIT', 'Do it!');
|
||||||
|
|
||||||
?>
|
?>
|
@@ -29,7 +29,7 @@ define("UCSLAN_15", "Create New Class");
|
|||||||
define("UCSLAN_18", "Clear Class");
|
define("UCSLAN_18", "Clear Class");
|
||||||
//define("UCSLAN_19", "Assign users to");
|
//define("UCSLAN_19", "Assign users to");
|
||||||
define("UCSLAN_20", "class");
|
define("UCSLAN_20", "class");
|
||||||
//define("UCSLAN_21", "User Class Settings");
|
define("UCSLAN_21", "User Class Settings");
|
||||||
//define("UCSLAN_22", "Users - click to move ...");
|
//define("UCSLAN_22", "Users - click to move ...");
|
||||||
//define("UCSLAN_23", "Users in this class ...");
|
//define("UCSLAN_23", "Users in this class ...");
|
||||||
define("UCSLAN_24", 'Class Manager');
|
define("UCSLAN_24", 'Class Manager');
|
||||||
|
@@ -2,31 +2,118 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* Template for signup emails
|
* Templates for all emails
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_themes/templates/email_template.php,v $
|
* $URL: $
|
||||||
* $Revision$
|
* $Revision: 11315 $
|
||||||
* $Date$
|
* $Id: $
|
||||||
* $Author$
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package e107
|
||||||
|
* @subpackage e107_templates
|
||||||
|
* @version $Id: mail_manager_class.php 11315 2010-02-10 18:18:01Z secretr $;
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file defines the default templates for each type of email which may be sent.
|
||||||
|
* In general it is assumed that HTML emails are being sent (with a plain text alternate part), although simple plain text emails are also possible.
|
||||||
|
*
|
||||||
|
* Default values are defined for the key elements of an email:
|
||||||
|
*
|
||||||
|
* $EMAIL_HEADER - the first part of the email, usually defining the headers, and everything up to and including <body>
|
||||||
|
* $EMAIL_FOOTER - the last part of the email - it may include a displayed footer, as well as </body> and other 'closing' tags
|
||||||
|
*
|
||||||
|
* Taken as a pair, $EMAIL_HEADER.$EMAIL_FOOTER must generate standards-compliant XHTML
|
||||||
|
*
|
||||||
|
* $EMAIL_BODY - the body text of the email - essentially, the message. It gets sandwiched between $EMAIL_HEADER and $EMAIL_FOOTER
|
||||||
|
* This must generate standards-compliant XHTML in its own right, when taken with an appropriate header and footer section.
|
||||||
|
* Within the template definition, insert the shortcode '{BODY}' to indicate where the passed text of the email is to be stored.
|
||||||
|
*
|
||||||
|
* $EMAIL_OVERRIDES may optionally be defined, in which case it can override default mailout settings (see later). Only define this variable
|
||||||
|
* if you explicitly want overrides - a defined, but empty, variable may have unexpected consequences!
|
||||||
|
*
|
||||||
|
* $EMAIL_PLAINTEXT - an alternative template for the alternative text part of HTML emails. Set to empty string if hard-coded default to be used
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Templates may be defined for specific purposes
|
||||||
|
* Each template is given a name, which is the name of the variable.
|
||||||
|
* This variable may be a simple string, in which case it defines the email body, and is only available via code.
|
||||||
|
* Alternatively the variable may be an array, in which case each element of the array defines a different aspect of the email:
|
||||||
|
*
|
||||||
|
* $NAME['template_name'] is a user-friendly name shown in the mass mailer
|
||||||
|
* $NAME['template_type'] takes values (user|system|all) to define its purpose - only 'user' and 'all' templates are shown in the mass mailer
|
||||||
|
* $NAME['email_header'] defines the header - optional
|
||||||
|
* $NAME['email_footer'] defines the footer - optional
|
||||||
|
* $NAME['email_body'] defines the body text
|
||||||
|
* $NAME['email_overrides'] defines any mailout settings which are to be overridden (see later) - optional
|
||||||
|
*
|
||||||
|
* The format and functionality of these four main array elements correspond exactly to those of the defaults already described.
|
||||||
|
*
|
||||||
|
* The template need only define those variables which are to be overridden, in which case the default definitions will be used for the others.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* For templated HTML emails, a style sheet MUST be specified in the header field (if its required), in one of the following forms:
|
||||||
|
*
|
||||||
|
* {STYLESHEET} - embeds the stylesheet for the current site theme
|
||||||
|
* {STYLESHEET=filename,link} - embeds a link to the referenced stylesheet file
|
||||||
|
* {STYLESHEET=filename} - embeds the contents of the specified file
|
||||||
|
* {STYLESHEET=filename,embed} - embeds the contents of the specified file
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Where no style sheet is specified for an HTML-format email, the following applies:
|
||||||
|
* If 'emailstyle.css' exists in the current theme directory, it is used
|
||||||
|
* otherwise, the theme's 'style.css' is used
|
||||||
|
*
|
||||||
|
* The override variable is an array, which can override any of the following mailer parameters:
|
||||||
|
'mailer', 'smtp_server', 'smtp_username', 'smtp_password', 'sendmail', 'siteadminemail', 'siteadmin', 'smtp_pop3auth',
|
||||||
|
'SMTPDebug', 'subject', 'from', 'fromname', 'replyto', 'send_html', 'add_html_header', 'attachments', 'cc', 'bcc',
|
||||||
|
'bouncepath', 'returnreceipt', 'priority', 'extra_header', 'wordwrap', 'split'
|
||||||
|
|
||||||
|
See e_HANDLER.mail.php for more information
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
global $pref;
|
|
||||||
|
// @TODO: Move signup email into templated form
|
||||||
|
$includeSiteButton = e107::getPref('sitebutton');
|
||||||
|
|
||||||
|
|
||||||
$SIGNUPEMAIL_SUBJECT = LAN_SIGNUP_96.' {SITENAME}';
|
$SIGNUPEMAIL_SUBJECT = LAN_SIGNUP_96.' {SITENAME}';
|
||||||
$SIGNUPEMAIL_USETHEME = 1; // Use CSS STYLE from THEME: 0 = Off, 1 = external, 2 = embedded
|
$SIGNUPEMAIL_USETHEME = 1; // Use CSS STYLE from THEME: 0 = Off, 1 = external, 2 = embedded
|
||||||
$SIGNUPEMAIL_LINKSTYLE = ''; // css to use on links eg. color:red;
|
$SIGNUPEMAIL_LINKSTYLE = ''; // css to use on links eg. color:red;
|
||||||
//$SIGNUPEMAIL_IMAGES = e_IMAGE.$pref['sitebutton']; // comma separated paths to image to embed. referenced below with {IMAGE1} (IMAGE2} etc. Not required
|
//$SIGNUPEMAIL_IMAGES = e_IMAGE.$includeSiteButton; // comma separated paths to image to embed. referenced below with {IMAGE1} (IMAGE2} etc. Not required
|
||||||
$SIGNUPEMAIL_CC = ""; // comma separated email addresses to put in CC of the signup email.
|
$SIGNUPEMAIL_CC = ""; // comma separated email addresses to put in CC of the signup email.
|
||||||
$SIGNUPEMAIL_BCC = ""; // comma separated email addresses to put in BCC of the signup email.
|
$SIGNUPEMAIL_BCC = ""; // comma separated email addresses to put in BCC of the signup email.
|
||||||
$SIGNUPEMAIL_ATTACHMENTS = ""; // files-path array of attachments. eg. array(e_FILE."myfile.zip",e_FILE."myotherfile.zip");
|
$SIGNUPEMAIL_ATTACHMENTS = ""; // files-path array of attachments. eg. array(e_FILE."myfile.zip",e_FILE."myotherfile.zip");
|
||||||
$SIGNUPEMAIL_BACKGROUNDIMAGE = ""; // absolute path to a background image eg. e_IMAGE."mybackground.jpg";
|
$SIGNUPEMAIL_BACKGROUNDIMAGE = ""; // absolute path to a background image eg. e_IMAGE."mybackground.jpg";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*===========================================================================
|
||||||
|
DEFAULT EMAIL TEMPLATE VALUES
|
||||||
|
=============================================================================*/
|
||||||
|
/**
|
||||||
|
These defaults are used if not overridden by the requirements for a specific template.
|
||||||
|
|
||||||
|
There are five defaults, which must exist, and must be named as follows:
|
||||||
|
$EMAIL_OVERRIDES - array of override settings; e.g. for mail server to use
|
||||||
|
$EMAIL_HEADER - string for the first part of an HTML email
|
||||||
|
$EMAIL_BODY - the 'body' text (usually a default here is meaningless!)
|
||||||
|
$EMAIL_FOOTER - a standard footer - could include a disclaimer, a link to the site
|
||||||
|
$EMAIL_PLAINTEXT - an alternative template for the alternative text part of HTML emails (if empty, alternate text is
|
||||||
|
derived from the HTLM body.
|
||||||
|
|
||||||
|
In most cases only the body will be overridden; in this case it can be overridden using a variable rather than an array.
|
||||||
|
*/
|
||||||
/*
|
/*
|
||||||
Optional mailer admin preferences Override. The following mailer parameters can be overridden:
|
Optional mailer admin preferences Override. The following mailer parameters can be overridden:
|
||||||
'mailer', 'smtp_server', 'smtp_username', 'smtp_password', 'sendmail', 'siteadminemail', 'siteadmin', 'smtp_pop3auth',
|
'mailer', 'smtp_server', 'smtp_username', 'smtp_password', 'sendmail', 'siteadminemail', 'siteadmin', 'smtp_pop3auth',
|
||||||
@@ -34,32 +121,31 @@ Optional mailer admin preferences Override. The following mailer parameters can
|
|||||||
'bouncepath', 'returnreceipt', 'priority', 'extra_header', 'wordwrap', 'split'
|
'bouncepath', 'returnreceipt', 'priority', 'extra_header', 'wordwrap', 'split'
|
||||||
|
|
||||||
See e_HANDLER.mail.php for more information
|
See e_HANDLER.mail.php for more information
|
||||||
|
|
||||||
If required, uncomment the following block and add array elements for options to be overridden - array key is the option name
|
If required, uncomment the following block and add array elements for options to be overridden - array key is the option name
|
||||||
DON'T put in empty fields unless you wish to set the value to an empty value! */
|
DON'T put in empty fields unless you wish to set the value to an empty value! */
|
||||||
/*
|
/*
|
||||||
global $EMAIL_OVERRIDES;
|
|
||||||
$EMAIL_OVERRIDES = array(
|
$EMAIL_OVERRIDES = array(
|
||||||
'bouncepath' => 'some email address',
|
'bouncepath' => 'some email address',
|
||||||
'returnreceipt' => 1
|
'returnreceipt' => 1
|
||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
// Not used in signup email
|
||||||
* Default HEADER for all emails
|
|
||||||
*/
|
|
||||||
$EMAIL_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
|
$EMAIL_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
|
||||||
<html xmlns='http://www.w3.org/1999/xhtml' >
|
<html xmlns='http://www.w3.org/1999/xhtml' >
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
||||||
|
{STYLESHEET}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div style='padding:0px 10px'>
|
<div style='padding:10px'>
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
/**
|
$EMAIL_BODY = 'Software malfunction - no email body text specified for template'; // Help debug
|
||||||
* Default FOOTER for all emails
|
|
||||||
*/
|
// Not used in signup email
|
||||||
$EMAIL_FOOTER = "
|
$EMAIL_FOOTER = "
|
||||||
<br /><br />
|
<br /><br />
|
||||||
{SITENAME=link}
|
{SITENAME=link}
|
||||||
@@ -68,22 +154,43 @@ $EMAIL_FOOTER = "
|
|||||||
</html>";
|
</html>";
|
||||||
|
|
||||||
|
|
||||||
/**
|
$EMAIL_PLAINTEXT = '';
|
||||||
* Mass-Mailing HEADER (admin->mailout)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*===========================================================================
|
||||||
|
TEMPLATES FOR SPECIFIC EMAIL TYPES
|
||||||
|
=============================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
Each template is an array whose name must match that used in the code.
|
||||||
|
The array has two mandatory elements (name and type).
|
||||||
|
The array may have up to five optional elements, each of which overrides the corresponding default value if present
|
||||||
|
An empty element sets the field to empty.
|
||||||
|
An element that is not present results in the default being used.
|
||||||
|
|
||||||
|
Elements are as follows:
|
||||||
|
'template_name' - string - mandatory - a 'user-friendly' name for display
|
||||||
|
'template_type' - string(user|system|all) - mandatory - 'all' and 'user' templates are available for selection in the bulk mailer
|
||||||
|
'email_overrides' - an array
|
||||||
|
'email_header' - string
|
||||||
|
'email_body' - string
|
||||||
|
'email_footer' - string
|
||||||
|
'email_plainText' - string
|
||||||
|
|
||||||
|
// If everything is standard apart from the body, the body can be defined as a simple variable
|
||||||
|
|
||||||
|
*/
|
||||||
|
//TODO - integrate into mailout routine
|
||||||
|
/*
|
||||||
$MAILOUT_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
|
$MAILOUT_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
|
||||||
<html xmlns='http://www.w3.org/1999/xhtml' >
|
<html xmlns='http://www.w3.org/1999/xhtml' >
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
||||||
|
{STYLESHEET}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div style='padding:0px 10px'>
|
<div style='padding:10px'>
|
||||||
";
|
";
|
||||||
|
|
||||||
/**
|
|
||||||
* Mass-Mailing FOOTER (admin->mailout)
|
|
||||||
*/
|
|
||||||
$MAILOUT_FOOTER = "
|
$MAILOUT_FOOTER = "
|
||||||
<br /><br />
|
<br /><br />
|
||||||
{SITENAME=link}
|
{SITENAME=link}
|
||||||
@@ -92,35 +199,16 @@ $MAILOUT_FOOTER = "
|
|||||||
</html>";
|
</html>";
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notification Email HEADER (admin->notify)
|
|
||||||
*/
|
|
||||||
//TODO - integrate into notification routine
|
|
||||||
$NOTIFY_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
|
|
||||||
<html xmlns='http://www.w3.org/1999/xhtml' >
|
|
||||||
<head>
|
|
||||||
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div style='padding:0px 10px'>
|
|
||||||
";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Notification Email FOOTER (admin->notify)
|
|
||||||
*/
|
|
||||||
$NOTIFY_FOOTER = "
|
|
||||||
<br /><br />
|
|
||||||
{SITENAME=link}
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>";
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SIGNUP EMAIL TEMPLATE - BODY.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
// 'SIGNUP' TEMPLATE
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
$SIGNUPEMAIL_TEMPLATE = "
|
$SIGNUPEMAIL_TEMPLATE = "
|
||||||
<div style='padding:0px 10px'>
|
<div style='padding:10px'>
|
||||||
<div style='text-align:left; width:90%'>
|
<div style='text-align:left; width:90%'>
|
||||||
".LAN_EMAIL_01." {USERNAME},<br />
|
".LAN_EMAIL_01." {USERNAME},<br />
|
||||||
<br />".
|
<br />".
|
||||||
@@ -143,21 +231,89 @@ LAN_SIGNUP_97." {SITENAME}<br />
|
|||||||
<br />
|
<br />
|
||||||
{SITENAME}<br />
|
{SITENAME}<br />
|
||||||
{SITEURL}
|
{SITEURL}
|
||||||
<br /><br />".($pref['sitebutton'] ? "<a href='".SITEURL."' title=''><img src='".e_IMAGE_ABS.str_replace('{e_IMAGE}', '', $pref['sitebutton'])."' alt='' /></a>" : '')."
|
<br /><br />".($includeSiteButton ? "<a href='".SITEURL."' title=''><img src='".e_IMAGE_ABS.str_replace('{e_IMAGE}', '', $includeSiteButton)."' alt='' /></a>" : '')."
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
";
|
";
|
||||||
|
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
// 'NOTIFY' TEMPLATE
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
$NOTIFY_TEMPLATE = array(
|
||||||
|
'template_name' => 'Notify',
|
||||||
|
'template_type' => 'system',
|
||||||
|
'email_overrides' => '',
|
||||||
|
'email_header' => "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
|
||||||
|
<html xmlns='http://www.w3.org/1999/xhtml' >
|
||||||
|
<head>
|
||||||
|
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style='padding:0px 10px'>
|
||||||
|
",
|
||||||
|
'email_body' => '{BODY}',
|
||||||
|
'email_footer' => "<br /><br />
|
||||||
|
{SITENAME=link}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>",
|
||||||
|
'email_plainText' => ''
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------
|
||||||
|
// USER-DEFINED TEMPLATES (for mass mailouts)
|
||||||
|
//-------------------------------------------------------------
|
||||||
/*
|
/*
|
||||||
* QUICK ADD USER EMAIL TEMPLATE - BODY.
|
$TEST_TEMPLATE = array(
|
||||||
* This is the email that is sent when an admin creates a user account in admin. "Quick Add User"
|
'template_name' => 'TEst1',
|
||||||
USRLAN_185 = A user account has been created for you at {SITEURL} with the following login:<br />Login Name: {LOGIN}<br />Password: {PASSWORD}<br/><br />
|
'template_type' => 'system',
|
||||||
USRLAN_186 = Please go to the site as soon as possible and log in, then change your password using the \'Settings\' option.<br /><br />
|
'email_overrides' => '',
|
||||||
You can also change other settings at the same time.<br /><br />Note that your password cannot be recovered if you lose it.
|
// 'email_header' - any header information (usually loaded from the default)
|
||||||
*/
|
'email_body' => '{BODY}',
|
||||||
|
'email_footer' => 'footer',
|
||||||
$QUICKADDUSER_TEMPLATE = "<div>".USRLAN_185.USRLAN_186."</div>";
|
'email_plainText' => ''
|
||||||
|
);
|
||||||
|
$TEST2_TEMPLATE = array(
|
||||||
|
'template_name' => 'TEst2',
|
||||||
|
'template_type' => 'all',
|
||||||
|
'email_overrides' => '',
|
||||||
|
// 'email_header' - any header information (usually loaded from the default)
|
||||||
|
'email_body' => '{BODY}',
|
||||||
|
'email_footer' => 'footer'
|
||||||
|
);
|
||||||
|
$TEST3_TEMPLATE = array(
|
||||||
|
'template_name' => 'TEst4',
|
||||||
|
'template_type' => 'user',
|
||||||
|
'email_overrides' => '',
|
||||||
|
// 'email_header' - any header information (usually loaded from the default)
|
||||||
|
'email_body' => '{BODY}',
|
||||||
|
'email_footer' => 'footer'
|
||||||
|
);
|
||||||
|
$TEST4_TEMPLATE = array(
|
||||||
|
'template_name' => 'TEst5',
|
||||||
|
'email_overrides' => '',
|
||||||
|
// 'email_header' - any header information (usually loaded from the default)
|
||||||
|
'email_body' => '{BODY}',
|
||||||
|
'email_footer' => 'footer'
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
$WHATSNEW_TEMPLATE = array(
|
||||||
|
'template_name' => 'WhatsNew',
|
||||||
|
'template_type' => 'user',
|
||||||
|
'email_overrides' => '',
|
||||||
|
// 'email_header' - any header information (usually loaded from the default)
|
||||||
|
'email_body' => 'All the latest news and updates.<br />{BODY}<br />To find out more, simply click on the links!',
|
||||||
|
// 'email_footer' => 'footer'
|
||||||
|
);
|
||||||
|
$MONTHLYUPDATE_TEMPLATE = array(
|
||||||
|
'template_name' => 'MonthlyUpdate',
|
||||||
|
'template_type' => 'user',
|
||||||
|
'email_overrides' => '',
|
||||||
|
// 'email_header' - any header information (usually loaded from the default)
|
||||||
|
'email_body' => 'Just to keep you up to date, here\'s a reminder of what\'s changed in the past month.<br />
|
||||||
|
{BODY}<br />To find out more, simply click on the links!',
|
||||||
|
// 'email_footer' => 'footer'
|
||||||
|
);
|
||||||
|
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user