function send_register_mail($mail_send_to, $filename, $modulname, $u_name, $password, $x_pos, $y_pos) { global $op_admin_email, $op_set_author, $op_set_gamename, $tpl, $op_send_html_mail; require_once LITO_INCLUDES_PATH . 'mime_mail.class.php'; $mime = new MIME_Mail(); $html = ""; $from_e = $op_admin_email; $from_n = $op_set_author; $to_e = $mail_send_to; $to_n = $mail_send_to; $text = "Registrierung bei " . $op_set_gamename; $filename_txt = str_replace('.html', '.txt', $filename); $html = $tpl->fetch(LITO_THEMES_PATH . $modulname . '/' . $filename); $txt = $tpl->fetch(LITO_THEMES_PATH . $modulname . '/' . $filename_txt); $searchReplace = array('[REG_USERNAME]' => $u_name, '[REG_PASSWORD]' => $password, '[REG_X_POS]' => $x_pos, '[REG_Y_POS]' => $y_pos, '[REG_GAME_NAME]' => $op_set_gamename); $html = str_replace(array_keys($searchReplace), array_values($searchReplace), $html); $txt = str_replace(array_keys($searchReplace), array_values($searchReplace), $txt); $key = "Mailer"; $val = "Litotex mailer"; //$mime->addXHeader( $key, $val ); $mime->addXHeader("", ""); $mime->addTo($to_e, $to_n); $mime->setFrom($from_e, $from_n); $mime->setSubject($text); $mime->setPriority(3); if (intval($op_send_html_mail) == 1) { $mime->setHTMLPart($html); $mime->sendMail(); } else { $mime->setPlainPart($txt); mail($to_e, $text, $txt, "From: {$from_e}"); } }
if (isset($count)) { $db->modifyLimitQuery($query, $from, $count); } $res = $db->query($query); if ($res instanceof PEAR_Error) { $cli->fatal($res); } $cli->message($res->numRows(), 'cli.success'); $subject = sprintf('News on %s', $registry->get('name', 'horde')); $body = "Hello %s,\n\n There is someting new on %s\n\n. Visit us at %s"; // Prepare data for bash process or delete one by one $paths = array(); while ($row =& $res->fetchRow()) { $body2 = sprintf($body, $row[0], $registry->get('name', 'horde'), Folks::getUrlFor('user', $row[0], true, -1)); // Send mail $mail = new MIME_Mail($subject, $body2, $row[1], $conf['support'], 'UTF-8'); $mail->addHeader('User-Agent', 'Folks' . $registry->getVersion()); $sent = $mail->send($conf['mailer']['type'], $conf['mailer']['params']); if ($sent instanceof PEAR_Error) { $cli->message($sent, 'cli.warning'); } else { $cli->message($row[0], 'cli.success'); } // sleep(1); } $cli->message('done', 'cli.success'); /** * Show the command line arguments that the script accepts. */ function showHelp() {