0) { $check = substr($test2, $idx, 1); if (!in_array($check, $GLOBALS['valid_email_chars'])) { // Char found so we end here break; } $idx--; } if ($idx > 0) { // Starting mark is found $check2 = substr($test, 0, ($idx + 1)); $test = substr($test, ($idx + 1)); } // And now go forward... $idx = '0'; while ($idx < strlen($test)) { $check = substr($test, $idx, 1); if ((!in_array($check, $GLOBALS['valid_email_chars'])) && ($check != '@')) { // Char found so end here again break; } $idx++; } if ($idx > 0) { // Maybe this is the email address? $check = substr($test, 0, $idx); } // Now replace the email against anchor with mailto and pray... $PARTS[] = $check2 . $check; // Remove email from testing string (see above why...) $test = substr($test, strlen($check)); } // Now put all parts together $text = ''; $PARTS[] = $test; foreach ($PARTS as $part) { $text .= $part; } // Pre-ompile possible own HTML tags out... return preCompileCode($text); } // Wrapper for sending newsletter and wrapping URLs / HTML mail function sendNewsletter ($to, $subject, $message, $mode) { // Send mail away as HTML if (postRequestElement('auto_urls') == 'Y') { // Automatically insert URLs into newsletter if ((isExtensionActive('html_mail')) && ($mode == 'html')) { // Send HTML mail sendEmail($to, $subject, insertUrlsIntoHtml($message), 'Y'); } else { // Send normal mail sendEmail($to, $subject, insertNewsletterUrls($message), 'N'); } } else { // Regular send-out if ((isExtensionActive('html_mail')) && ($mode == 'html')) { sendEmail($to, $subject, $message, 'Y'); } else { sendEmail($to, $subject, $message, 'N'); } } } // ?>