diff --git a/e107_handlers/bounce_handler.php b/e107_handlers/bounce_handler.php
index 760b799ea..81463ca0a 100644
--- a/e107_handlers/bounce_handler.php
+++ b/e107_handlers/bounce_handler.php
@@ -109,7 +109,12 @@ class e107Bounce
{
if($errors = $this->setUser_Bounced($e107_userid))
{
- // $message .= print_a($errors,true);
+ if($this->debug)
+ {
+ echo "
Errors
";
+ print_a($errors);
+ }
+
}
}
@@ -194,13 +199,18 @@ class e107Bounce
function setUser_Bounced($bounceString = '', $email='' )
{
- if(!$email && !$bounceString){ return; }
+ if(!$email && !$bounceString)
+ {
+ return false;
+ }
// echo "Email bounced ID: ".$id_or_email;
- require_once(e_HANDLER.'mail_manager_class.php');
- $mailManager = new e107MailManager();
+ $mailManager = e107::getBulkEmail();
+
+ $mailManager->controlDebug($this->debug);
+
if ($errors = $mailManager->markBounce($bounceString, $email))
- {
+ {
return $errors; // Failure
}
diff --git a/e107_handlers/mail.php b/e107_handlers/mail.php
index 986313fff..e3ca1abca 100644
--- a/e107_handlers/mail.php
+++ b/e107_handlers/mail.php
@@ -570,7 +570,7 @@ class e107Email extends PHPMailer
$this->MsgHTML($message); // Theoretically this should do everything, including handling of inline images.
-
+
}
else
{ // generate the plain text as the sole part of the email
@@ -781,8 +781,8 @@ class e107Email extends PHPMailer
if($this->debug)
{
- echo "e107Email::arraySet() - line ".__LINE__."
";
- print_a($tmpl);
+ // echo "e107Email::arraySet() - line ".__LINE__."
";
+ // print_a($tmpl);
}
unset($eml['add_html_header']); // disable other headers when template is used.
@@ -865,8 +865,9 @@ class e107Email extends PHPMailer
if($this->debug)
{
- echo "e107Email::arraySet() - line ".__LINE__."
";
- print_a($eml);
+ // echo "e107Email::arraySet() - line ".__LINE__."
";
+ return 0;
+ // print_a($eml);
//$this->PreSend();
//$debugEml = $this->GetSentMIMEMessage().
//print_a($debugEml);
@@ -947,7 +948,7 @@ class e107Email extends PHPMailer
$result = TRUE; // Temporary 'success' flag
$this->SendCount++;
- if (($this->logEnable == 0) || ($this->logEnable == 2))
+ if ($this->debug == false && (($this->logEnable == 0) || ($this->logEnable == 2)) )
{
// prevent user/script details being exposed in X-PHP-Script header
$oldphpself = $_SERVER['PHP_SELF'];
@@ -969,8 +970,11 @@ class e107Email extends PHPMailer
}
else
{ // Debug
- $result = TRUE;
- //print_a($this);
+ $result = true;
+ // echo "SendEmail()->Body
";
+ // print_a($this->Body);
+ // echo "SendEmail()->AltBody
";
+ // print_a($this->AltBody);
if (($this->logEnable == 3) && (($this->SendCount % 7) == 4)) $result = FALSE; // Fail one email in 7 for testing
}
@@ -1015,6 +1019,10 @@ class e107Email extends PHPMailer
}
+ function setDebug($val)
+ {
+ $this->debug = $val;
+ }
/**
* Called after a bulk mailing completed, to tidy up nicely
@@ -1126,18 +1134,30 @@ class e107Email extends PHPMailer
$this->IsHTML(true);
$this->Body = $message;
//print_a($message);
- $textMsg = str_replace(array('
', '
'), "\n", $message); // Modified to make sure newlines carried through
+ $textMsg = str_replace("\n", "", $message);
+ $textMsg = str_replace(array('
', '
'), "\n", $textMsg); // Modified to make sure newlines carried through
$textMsg = preg_replace('#^.*?#', '', $textMsg); // Knock off everything up to and including the body statement (if present)
$textMsg = preg_replace('#.*$#', '', $textMsg); // Knock off everything after and including the