X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Femail-functions.php;h=90ec5441b96b6cd7c803a7f990cc6df02f4edcea;hb=e5527fd38a6585c8466dc28d013f12d21eb7c07a;hp=43cedae31ec08752a2b3822293ea4bd630296379;hpb=1b80720b69d8de70d2119165cdf2e402b0514adf;p=mailer.git diff --git a/inc/email-functions.php b/inc/email-functions.php index 43cedae31e..90ec5441b9 100644 --- a/inc/email-functions.php +++ b/inc/email-functions.php @@ -10,13 +10,13 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Mailversand bezogene Funktionen * * -------------------------------------------------------------------- * - * $Revision:: 2773 $ * - * $Date:: 2012-06-26 01:02:44 +0200 (Tue, 26 Jun 2012) $ * + * $Revision:: $ * + * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * - * $Author:: quix0r $ * + * $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; @@ -139,7 +143,7 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) { $mail->CharSet = 'UTF-8'; // Path for PHPMailer - $mail->PluginDir = sprintf("%sinc/phpmailer/", getPath()); + $mail->PluginDir = sprintf('%sinc/phpmailer/', getPath()); $mail->IsSMTP(); $mail->SMTPAuth = 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));