X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Femail-functions.php;h=e0cf2a251e3889e9ddeb2fcb8ba1c0ac42245c37;hb=9179301d4bd1f2303791add8b2ee19f41979aeb0;hp=bb4f0e55eb863de23c59bcfdc2a14ac1454b2797;hpb=db99cc1900f188a2262be615c42a8e50c1ddb86c;p=mailer.git diff --git a/inc/email-functions.php b/inc/email-functions.php index bb4f0e55eb..e0cf2a251e 100644 --- a/inc/email-functions.php +++ b/inc/email-functions.php @@ -59,7 +59,7 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = ' // Set webmaster $toEmail = getWebmaster(); } - } elseif ($toEmail == '0') { + } elseif (($toEmail == '0') || (is_null($toEmail))) { // Is the webmaster! $toEmail = getWebmaster(); } @@ -91,7 +91,7 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = ' '); // This is always fine - return true; + return TRUE; } elseif (!empty($toEmail)) { // Send Mail away return sendRawEmail($toEmail, $subject, $message, $mailHeader); @@ -116,12 +116,12 @@ function isPhpMailerConfigured () { // Send out a raw email with PHPMailer class or plain mail() command function sendRawEmail ($toEmail, $subject, $message, $headers) { // Just compile all to put out all configs, etc. - $eval = '$toEmail = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($toEmail), false)) . '"); '; - $eval .= '$subject = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($subject), false)) . '"); '; - $eval .= '$headers = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($headers), false)) . '"); '; + $eval = '$toEmail = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($toEmail), FALSE)) . '"); '; + $eval .= '$subject = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($subject), FALSE)) . '"); '; + $eval .= '$headers = decodeEntities("' . escapeQuotes(doFinalCompilation(compileRawCode($headers), FALSE)) . '"); '; // Do not decode entities in the message because we also send HTML mails through this function - $eval .= '$message = "' . escapeQuotes(doFinalCompilation(compileRawCode($message), false)) . '";'; + $eval .= '$message = "' . escapeQuotes(doFinalCompilation(compileRawCode($message), FALSE)) . '";'; // Run the final eval() command eval($eval); @@ -142,7 +142,7 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) { $mail->PluginDir = sprintf("%sinc/phpmailer/", getPath()); $mail->IsSMTP(); - $mail->SMTPAuth = true; + $mail->SMTPAuth = TRUE; $mail->Host = getConfig('SMTP_HOSTNAME'); $mail->Port = 25; $mail->Username = getConfig('SMTP_USER'); @@ -158,7 +158,7 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) { $mail->Body = $message; $mail->AltBody = decodeEntities($message); $mail->WordWrap = 70; - $mail->IsHTML(true); + $mail->IsHTML(TRUE); } else { $mail->Body = decodeEntities(strip_tags($message)); } @@ -176,10 +176,10 @@ function sendRawEmail ($toEmail, $subject, $message, $headers) { logDebugMessage(__FUNCTION__, __LINE__, 'Error while sending mail: ' . $mail->ErrorInfo); // Raise an error - return false; + return FALSE; } else { // All fine! - return true; + return TRUE; } } else { // Use plain mail() command