X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Femail-functions.php;h=3663ca4ce8e49d03d6638666ae0a7aeff02b0a07;hp=4a2fc72ba32ef0cdf93c56bed613a99d02a83fce;hb=8cab12aa2bd0bd1de03a377b37cd42faae64b0e1;hpb=64b24587e9e280798311c903cb11440c62f2844d diff --git a/inc/email-functions.php b/inc/email-functions.php index 4a2fc72ba3..3663ca4ce8 100644 --- a/inc/email-functions.php +++ b/inc/email-functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -50,7 +50,7 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = ' } // END - if // Set from header - if ((!isInString('@', $toEmail)) && ($toEmail > 0)) { + if ((!isInString('@', $toEmail)) && (isValidId($toEmail))) { // Does the user exist? if ((isExtensionActive('user')) && (fetchUserData($toEmail))) { // Get the email @@ -81,14 +81,18 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = ' } // END - if // Debug mode enabled? - if (isDebugModeEnabled()) { - // In debug mode we want to display the mail instead of sending it away so we can debug this part - outputHtml('
-Headers : ' . htmlentities(trim($mailHeader)) . '
-To      : ' . htmlentities($toEmail) . '
-Subject : ' . htmlentities($subject) . '
-Message(' . strlen($message) . ') : ' . htmlentities($message) . '
-
'); + if ((isDebugModeEnabled()) && (!isAjaxOutputMode())) { + // Init content array + $content = array( + 'headers' => htmlentities(trim($mailHeader)), + 'to' => htmlentities($toEmail), + 'subject' => htmlentities($subject), + 'message' => htmlentities($message), + 'length' => strlen($message) + ); + + // In debug mode display the mail instead of sending it away so it can be debugged + loadTemplate('display_email', FALSE, $content); // This is always fine return TRUE; @@ -223,7 +227,7 @@ function sendGenericBuildMails ($mode, $tableName, $content, $id, $subjectPart = } // END - if // Is the raw userid set? - if (isValidUserId(postRequestElement($userIdColumn[0], $id))) { + if (isValidId(postRequestElement($userIdColumn[0], $id))) { // Set it in content $content[$userIdColumn[0]] = bigintval(postRequestElement($userIdColumn[0], $id));