X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=2d4fcf45df00abd20358f9515859241ca8e889f6;hb=247435718942b91af153c729c0347be3af1fecf9;hp=7b074a4a556feeb40c14ad00ef90e2e90e04129f;hpb=cd370210abb680d994a914e777b4b7cf07e0ac02;p=mailer.git diff --git a/inc/functions.php b/inc/functions.php index 7b074a4a55..2d4fcf45df 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -636,12 +636,12 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = ' if (empty($isHtml)) $isHtml = 'N'; if (isDebugModeEnabled()) { // In debug mode we want to display the mail instead of sending it away so we can debug this part - outputHtml("
-".htmlentities(trim($mailHeader))."
-To      : " . $toEmail."
-Subject : " . $subject."
-Message : " . $message."
-
\n"); + outputHtml('
+Headers : ' . htmlentities(trim($mailHeader)) . '
+To      : ' . $toEmail . '
+Subject : ' . $subject . '
+Message : ' . $message . '
+
'); } elseif (($isHtml == 'Y') && (isExtensionActive('html_mail'))) { // Send mail as HTML away sendHtmlEmail($toEmail, $subject, $message, $mailHeader); @@ -3576,5 +3576,29 @@ if (!function_exists('html_entity_decode')) { } } // END - if +if (!function_exists('http_build_query')) { + // Taken from documentation on www.php.net, credits to Marco K. (Germany) + function http_build_query($data, $prefix='', $sep='', $key='') { + $ret = array(); + foreach ((array)$data as $k => $v) { + if (is_int($k) && $prefix != null) { + $k = urlencode($prefix . $k); + } // END - if + + if ((!empty($key)) || ($key === 0)) $k = $key.'['.urlencode($k).']'; + + if (is_array($v) || is_object($v)) { + array_push($ret, http_build_query($v, '', $sep, $k)); + } else { + array_push($ret, $k.'='.urlencode($v)); + } + } // END - foreach + + if (empty($sep)) $sep = ini_get('arg_separator.output'); + + return implode($sep, $ret); + } +}// // END - if + // [EOF] ?>