/** * Build a nice email from the submitted data and send it */ function run($data, $thanks, $argv) { global $ID; // get recipient address(es) $to = join(',', $argv); $sub = sprintf($this->getLang('mailsubject'), $ID); $txt = sprintf($this->getLang('mailintro') . "\n\n\n", dformat()); foreach ($data as $opt) { $value = $opt->getParam('value'); $label = $opt->getParam('label'); switch ($opt->getFieldType()) { case 'fieldset': $txt .= "\n====== " . hsc($label) . " ======\n\n"; break; default: if ($value === null || $label === null) { break; } $txt .= $label . "\n"; $txt .= "\t\t{$value}\n"; } } global $conf; if (!mail_send($to, $sub, $txt, $conf['mailfrom'])) { throw new Exception($this->getLang('e_mail')); } return $thanks; }
function error($from, $msg) { $this->log(LOG_INFO, "Error: {$from} {$msg}"); $headers['To'] = $from; $headers['Subject'] = _m('Error'); return mail_send(array($from), $headers, $msg); }
function mail_debug($recipient = 'root@localhost', $sender = 'admin@localhost') { global $phpmailer, $mail_administrators; ob_start(); mail_send('RapidWebSMS - Send Mail Test.', 'This is a test.', $recipient, $sender, 'html'); return ob_get_clean(); }
function defaultAction() { $subjects = array(1 => array('id' => 1, 'title' => s('General question')), 2 => array('id' => 2, 'title' => s('Bug report')), 3 => array('id' => 3, 'title' => s('Collaboration or partership')), 4 => array('id' => 4, 'title' => s('Idea')), 5 => array('id' => 5, 'title' => s('Other'))); $html = ''; $errors = array(); $is_posted = request_int('is_posted'); $jump_to = 'feedback_name'; if ($is_posted) { if (!count($errors) && !request_str('email')) { $errors[] = s('Please, enter your email'); $jump_to = 'feedback_email'; } if (!count($errors) && request_str('email') && !filter_var(request_str('email'), FILTER_VALIDATE_EMAIL)) { $errors[] = s('Please, provide correct email address. For example: john@gmail.com'); $jump_to = 'feedback_email'; } if (!count($errors) && !request_str('message')) { $errors[] = s('Enter the message.'); $jump_to = 'feedback_password'; } if (!count($errors)) { $data = array('{name}' => request_str('name'), '{email}' => request_str('email'), '{subject}' => $subjects[request_int('subject_id')]['title'], '{message}' => request_str('message')); $message = str_replace(array_keys($data), array_values($data), 'Name: {name} Email: {email} Subject: {subject} {message} ' . $_SERVER['REMOTE_ADDR'] . ' ' . date('r')); core::$sql->insert(array('message' => core::$sql->s($message), 'insert_stamp' => core::$sql->i(time())), DB . 'feedback'); require_once '../mod/lib.mail.php'; foreach (array('*****@*****.**') as $email) { mail_send(request_str('name'), request_str('email'), $email, 'Metro4all.org - ' . $subjects[request_int('subject_id')]['title'], $message, false); } go(Core::$config['http_home'] . 'feedback/?action=ok'); } } $page = new PageCommon(s('Feedback')); $html .= $page->start(); $html .= '<div class="row"><div class="col-md-offset-2 col-md-8"><h2>' . s('Feedback') . '</h2>'; if (count($errors)) { $html .= '<div class="alert alert-danger"><p>' . escape($errors[0]) . '</p></div>'; } $form = new Form('feedback', false, 'post'); $html .= '<div class="well">' . $form->start() . $form->addVariable('is_posted', 1) . $form->addString('name', s('Name'), $is_posted ? request_str('name') : '') . $form->addString('email', s('E-mail'), $is_posted ? request_str('email') : '', array('is_required' => true)) . $form->addSelect('subject_id', s('Subject'), $is_posted ? request_int('subject_id') : 1, array('data' => $subjects)) . $form->addText('message', s('Message'), $is_posted ? request_str('message') : '', array('is_required' => true, 'style' => 'height:200px')) . $form->submit(s('Send')) . '</div>'; $html .= '<script> $(document).ready(function() { $("#' . $jump_to . '").focus(); }); </script>'; $html .= '</div></div>'; $html .= $page->stop(); return $html; }
/** * メールの送信 * * @param string $to * @param string $subject * @param string $message * @param array $headers * @param array $files * * @return bool */ function service_mail_send($to, $subject, $message, $headers = array(), $files = array()) { if ($GLOBALS['config']['mail_send'] === true) { return mail_send($to, $subject, $message, $headers); } else { $text = '――――――――――――――――――――' . "\n"; $text .= 'to: ' . $to . "\n"; $text .= '――――――――――――――――――――' . "\n"; $text .= 'subject: ' . $subject . "\n"; $text .= '――――――――――――――――――――' . "\n"; $text .= $message; return file_put_contents(MAIN_APPLICATION_PATH . 'mails/' . localdate('YmdHis') . '_' . $to . '.txt', $text); } }
/** * Build a nice email from the submitted data and send it */ function run($fields, $thanks, $argv) { global $ID; $this->prepareLanguagePlaceholder(); // get recipient address(es) $to = join(',', $argv); $replyto = array(); $headers = null; $subject = sprintf($this->getLang('mailsubject'), $ID); $txt = sprintf($this->getLang('mailintro') . "\n\n\n", dformat()); foreach ($fields as $opt) { /** @var syntax_plugin_bureaucracy_field $opt */ $value = $opt->getParam('value'); $label = $opt->getParam('label'); switch ($opt->getFieldType()) { case 'fieldset': $txt .= "\n====== " . hsc($label) . " ======\n\n"; break; case 'subject': $subject = $label; break; case 'email': if (!is_null($opt->getParam('replyto'))) { $replyto[] = $value; } /** fall through */ /** fall through */ default: if ($value === null || $label === null) { break; } $txt .= $label . "\n"; $txt .= "\t\t{$value}\n"; } $this->prepareFieldReplacements($label, $value); } $subject = $this->replaceDefault($subject); if (!empty($replyto)) { $headers = mail_encode_address(join(',', $replyto), 'Reply-To'); } global $conf; if (!mail_send($to, $subject, $txt, $conf['mailfrom'], '', '', $headers)) { throw new Exception($this->getLang('e_mail')); } return $thanks; }
function main_function($tls, $smtpserver, $username, $password, $port, $auth) { $msgarray = array(); try { $mail = mail_send($tls, $smtpserver, $username, $password, $port, $auth); if ($mail === true) { insert_into_db($tls, $smtpserver, $username, $password, $port, $auth); $constantresult = writeMailSettingsconstants($tls, $port, $username, $password, $smtpserver, $auth); if ($constantresult === true) { $msgarray['result'] = 'send'; } else { $msgarray['error'] = 'Some error occured'; } } else { $msgarray['error'] = $mail; } } catch (PDOException $ex) { $msgarray['error'] = 'Some error occured. ' . $ex->getMessage(); } return $msgarray; }
if (!isset($_SESSION['mail']['to']) && isset($_GET['id'])) { $_SESSION['mail']['to'] = intval(hesk_GET('id')); } } else { $hesk_settings['mailtmp']['this'] = 'to'; $hesk_settings['mailtmp']['other'] = 'from'; $hesk_settings['mailtmp']['m_from'] = $hesklang['m_from']; if ($action != 'read') { $hesk_settings['mailtmp']['inbox'] = '<b><img src="../img/inbox.png" width="16" height="16" alt="' . $hesklang['inbox'] . '" title="' . $hesklang['inbox'] . '" border="0" style="border:none;vertical-align:text-bottom" /> ' . $hesklang['inbox'] . '</b>'; $hesk_settings['mailtmp']['folder'] = ''; } } /* What should we do? */ switch ($action) { case 'send': mail_send(); break; case 'mark_read': mail_mark_read(); break; case 'mark_unread': mail_mark_unread(); break; case 'delete': mail_delete(); break; } /* Print header */ require_once HESK_PATH . 'inc/header.inc.php'; /* Print main manage users page */ require_once HESK_PATH . 'inc/show_admin_nav.inc.php';
function respond($from, $to, $response) { $headers['From'] = $to; $headers['To'] = $from; $headers['Subject'] = _('Command complete'); return mail_send(array($from), $headers, $response); }
/** * send a message to confirm a claim for an SMS number * * @param string $code confirmation code * @param string $nickname nickname of user claiming number * @param string $address email address to send the confirmation to * * @see common_confirmation_code() * * @return void */ function mail_confirm_sms($code, $nickname, $address) { $recipients = $address; $headers['From'] = mail_notify_from(); $headers['To'] = $nickname . ' <' . $address . '>'; // TRANS: Subject line for SMS-by-email address confirmation message. $headers['Subject'] = _('SMS confirmation'); // TRANS: Main body heading for SMS-by-email address confirmation message. // TRANS: %s is the addressed user's nickname. $body = sprintf(_("%s: confirm you own this phone number with this code:"), $nickname); $body .= "\n\n"; $body .= $code; $body .= "\n\n"; mail_send($recipients, $headers, $body); }
if (!$angkatan_lulus) { $error .= "Error: Formulir Angkatan Lulus belum diisi , silahkan ulangi.<br />"; } if ($error) { $tengah .= '<div class="error">' . $error . '</div>'; } else { $hasil1 = $koneksi_db->sql_query("INSERT INTO useraura (user, email, password , level, tipe, nama, alamat, propinsi, kota, telp, hp, angkatan_masuk, angkatan_lulus)VALUES('{$username}', '{$email}', '{$password}','User','aktif','{$nama}','{$alamat}','{$propinsi}','{$kota}','{$telp}','{$hp}','{$angkatan_masuk}','{$angkatan_lulus}')"); if ($hasil1) { $subject = "Your Account Information"; $header = $email_master; $message = "Your Account \r\n"; $message .= "<br /><br />"; $message .= "Username : "******" <br>Password : "******""; $message .= "<br />Please Don't Replay This Email, this is Automatic Email Because You Register in {$judul_situs} <br /><br />"; $message .= "<br /><br /><br />Regard:<br /><br />Webmaster<br />"; $sentmail = mail_send($email, $header, $subject, $message, 1, 1); $tengah .= '<div class="sukses">Please Login With Your Username and Your Password</div>'; unset($_POST); } } } $username = !isset($username) ? '' : $username; $email = !isset($email) ? '' : $email; $password = !isset($passwordn) ? '' : $password; $rpassword = !isset($rpassword) ? '' : $rpassword; $nama = !isset($nama) ? '' : $nama; $alamat = !isset($alamat) ? '' : $alamat; $propinsi = !isset($propinsi) ? '' : $propinsi; $kota = !isset($kota) ? '' : $kota; $telp = !isset($telp) ? '' : $telp; $hp = !isset($hp) ? '' : $hp;
/** * ACTION: cast a new vote * or save a changed vote * (If user is allowed to.) */ function castVote() { $fullname = hsc(trim($_REQUEST['fullname'])); $selected_indexes = $_REQUEST['selected_indexes']; // may not be set when all checkboxes are deseleted. if (empty($fullname)) { $this->template['msg'] = $this->getLang('dont_have_name'); return; } if (empty($selected_indexes)) { if ($this->params['voteType'] == 'multi') { $selected_indexes = array(); //allow empty vote only if voteType is "multi" } else { $this->template['msg'] = $this->getLang('select_one_option'); return; } } //---- check if user is allowed to vote, according to 'auth' parameter //if AUTH_USER, then user must be logged in if ($this->params['auth'] == self::AUTH_USER && !$this->isLoggedIn()) { $this->template['msg'] = $this->getLang('must_be_logged_in'); return; } //if AUTH_IP, then prevent duplicate votes by IP. //Exception: If user is logged in he is always allowed to change the vote with his fullname, even if he is on another IP. if ($this->params['auth'] == self::AUTH_IP && !$this->isLoggedIn() && !isset($_REQUEST['change__vote'])) { foreach ($this->doodle as $existintFullname => $userData) { if (strcmp($userData['ip'], $_SERVER['REMOTE_ADDR']) == 0) { $this->template['msg'] = sprintf($this->getLang('ip_has_already_voted'), $_SERVER['REMOTE_ADDR']); return; } } } //do not vote twice, unless change__vote is set if (isset($this->doodle["{$fullname}"]) && !isset($_REQUEST['change__vote'])) { $this->template['msg'] = $this->getLang('you_voted_already'); return; } //check if change__vote is allowed if (!empty($_REQUEST['change__vote']) && !$this->isAllowedToEditEntry($fullname)) { $this->template['msg'] = $this->getLang('not_allowed_to_change'); return; } if (!empty($_SERVER['REMOTE_USER'])) { $this->doodle["{$fullname}"]['username'] = $_SERVER['REMOTE_USER']; } $this->doodle["{$fullname}"]['choices'] = $selected_indexes; $this->doodle["{$fullname}"]['time'] = time(); $this->doodle["{$fullname}"]['ip'] = $_SERVER['REMOTE_ADDR']; $this->writeDoodleDataToFile(); $this->template['msg'] = $this->getLang('vote_saved'); //send mail if $params['adminMail'] is filled if (!empty($this->params['adminMail'])) { $subj = "[DoodlePlugin] Vote casted by {$fullname} (" . $this->doodle["{$fullname}"]['username'] . ')'; $body = 'User has casted a vote' . "\n\n" . print_r($this->doodle["{$fullname}"], true); mail_send($this->params['adminMail'], $subj, $body, $conf['mailfrom']); } }
$mod_aexpres_login = empty($_POST['mod_aexpres_login']) ? '' : check_string($_POST['mod_aexpres_login'], 'string'); $mod_mail_login = empty($_POST['mod_mail_login']) ? '' : check_string($_POST['mod_mail_login'], 'email'); // - unset($sprav_data, $areaArray, $postArray, $gildArray, $date_expl); // Удаление временных переменных // -- end ENV -- // // ----- BEGIN ----- // switch ($action) { case 'add': if ($stage == 'save') { $query_add = "INSERT INTO users(date_add,fio1,fio2,fio3,birthday,photo,post_id,area_id,gild_id,status,comment,admin_add_id) VALUES (NOW(),'" . $fio1 . "','" . $fio2 . "','" . $fio3 . "'," . $birthday . ",'" . $photoname . "'," . $post_id . "," . $area_id . "," . $gild_id . ",1,'" . $comment . "',(SELECT id from admins WHERE login='******'))"; if (write_data_to_db($query_add, 'insert')) { $msg = 'Заявка отправлена'; $msg_class = 'success'; $msg_mail = "Сотрудник " . $fio1 . ' ' . $fio2 . ' ' . $fio3 . " принят на должность " . $posts[$post_id] . " с " . date('d.m.Y') . "г." . $cfg_mail_sign; mail_send($cfg_mailto, "Новый сотрудник: " . $fio1 . " " . $fio2 . " " . $fio3, $msg_mail); } else { $msg = 'Ошибка!'; $msg_class = 'failed'; } } $page_name = 'Добавление нового сотрудника'; include "./forms/header.html"; include "./forms/uedit.php"; break; case 'edit': if ($stage == 'save' and $uid != '') { if ($permission_id == 1) { $query_edit_save = "UPDATE users SET date_mod=NOW(),fio1='" . $fio1 . "',fio2='" . $fio2 . "',fio3='" . $fio3 . "',birthday=" . $birthday . ",photo='" . $photoname . "',post_id=" . $post_id . ",area_id=" . $area_id . ",gild_id=" . $gild_id . ",comment='" . $comment . "',admin_mod_id=(SELECT id from admins WHERE login='******') WHERE id=" . $uid; if (write_data_to_db($query_edit_save, 'update')) { $msg = 'Данные сохранены';
/** * Sends a notify mail on page change * * @param string $id The changed page * @param string $who Who to notify (admin|subscribers) * @param int $rev Old page revision * @param string $summary What changed * @param boolean $minor Is this a minor edit? * @param array $replace Additional string substitutions, @KEY@ to be replaced by value * * @author Andreas Gohr <*****@*****.**> */ function notify($id, $who, $rev = '', $summary = '', $minor = false, $replace = array()) { global $lang; global $conf; // decide if there is something to do if ($who == 'admin') { if (empty($conf['notify'])) { return; } //notify enabled? $text = rawLocale('mailtext'); $to = $conf['notify']; $bcc = ''; } elseif ($who == 'subscribers') { if (!$conf['subscribers']) { return; } //subscribers enabled? if ($conf['useacl'] && $_SERVER['REMOTE_USER'] && $minor) { return; } //skip minors $bcc = subscriber_addresslist($id); if (empty($bcc)) { return; } $to = ''; $text = rawLocale('subscribermail'); } elseif ($who == 'register') { if (empty($conf['registernotify'])) { return; } $text = rawLocale('registermail'); $to = $conf['registernotify']; $bcc = ''; } else { return; //just to be safe } $text = str_replace('@DATE@', date($conf['dformat']), $text); $text = str_replace('@BROWSER@', $_SERVER['HTTP_USER_AGENT'], $text); $text = str_replace('@IPADDRESS@', $_SERVER['REMOTE_ADDR'], $text); $text = str_replace('@HOSTNAME@', gethostbyaddr($_SERVER['REMOTE_ADDR']), $text); $text = str_replace('@NEWPAGE@', wl($id, '', true), $text); $text = str_replace('@PAGE@', $id, $text); $text = str_replace('@TITLE@', $conf['title'], $text); $text = str_replace('@DOKUWIKIURL@', DOKU_URL, $text); $text = str_replace('@SUMMARY@', $summary, $text); $text = str_replace('@USER@', $_SERVER['REMOTE_USER'], $text); foreach ($replace as $key => $substitution) { $text = str_replace('@' . strtoupper($key) . '@', $substitution, $text); } if ($who == 'register') { $subject = $lang['mail_new_user'] . ' ' . $summary; } elseif ($rev) { $subject = $lang['mail_changed'] . ' ' . $id; $text = str_replace('@OLDPAGE@', wl($id, "rev={$rev}", true), $text); require_once DOKU_INC . 'inc/DifferenceEngine.php'; $df = new Diff(split("\n", rawWiki($id, $rev)), split("\n", rawWiki($id))); $dformat = new UnifiedDiffFormatter(); $diff = $dformat->format($df); } else { $subject = $lang['mail_newpage'] . ' ' . $id; $text = str_replace('@OLDPAGE@', 'none', $text); $diff = rawWiki($id); } $text = str_replace('@DIFF@', $diff, $text); $subject = '[' . $conf['title'] . '] ' . $subject; mail_send($to, $subject, $text, $conf['mailfrom'], '', $bcc); }
function respond($from, $to, $response) { $headers['From'] = $to; $headers['To'] = $from; // TRANS: E-mail subject for reply to an e-mail command. $headers['Subject'] = _('Command complete'); return mail_send(array($from), $headers, $response); }
function _save($data, $hlp) { global $ID; // on the first run for this page, clean up if (!isset($this->run[$ID])) { $hlp->cleanPageTasks($ID); $this->run[$ID] = true; } if ($data['state'] !== DOKU_LEXER_EXIT) { return; } // save the task data - only when not saved yet. if (in_array($data['task']['md5'], $this->saved)) { return; } $hlp->saveTask($data['task'] + array('page' => $ID, 'pos' => ++$this->position)); $this->saved[] = $data['task']['md5']; global $auth; if ($auth !== null && isset($data['task']['user']) && (!isset($_SERVER['REMOTE_USER']) || $data['task']['user'] !== $_SERVER['REMOTE_USER']) && (!isset($this->oldTasks[$data['task']['md5']]) || $this->oldTasks[$data['task']['md5']]['user'] !== $data['task']['user'])) { global $conf; $info = $auth->getUserData($data['task']['user']); mail_send($info['name'] . ' <' . $info['mail'] . '>', '[' . $conf['title'] . '] ' . sprintf($this->getLang('mail_subj'), $data['task']['text']), sprintf(file_get_contents($this->localFN('mail_body')), isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : $this->getLang('someone'), $data['task']['text'], isset($data['task']['date']) ? $data['task']['date'] : $this->getLang('nodue'), wl($ID, '', true, '&') . '#plgdo__' . $data['task']['md5']), $conf['mailfrom']); } }
function send_link($email, $url, &$valid_email) { if (!mail_isvalid($email)) { msg($this->getLang('bad_email') . $email); $valid_email = false; return false; } global $conf; $text = $this->getLang('email_confirm') . "\n\n"; $text .= $url; $text .= "\n\n"; $subject = $this->getLang('subject_confirm'); return mail_send($email, $subject . $conf['title'], $text, $conf['mailfrom']); }
/** * Send a real live email reminder * * @todo This would probably be better as two or more sep functions * * @param string $type type of reminder * @param mixed $object Confirm_address or Invitation object * @param string $subject subjct of the email reminder * @param string $title title of the email reminder * @return boolean true if the email subsystem doesn't explode */ static function sendReminderEmail($type, $object, $subject, $title = null) { $sitename = common_config('site', 'name'); $recipients = array($object->address); $inviter = null; $inviterurl = null; if ($type == UserInviteReminderHandler::INVITE_REMINDER) { $user = User::getKV($object->user_id); if (!empty($user)) { $profile = $user->getProfile(); $inviter = $profile->getBestName(); $inviterUrl = $profile->profileurl; } } $headers['From'] = mail_notify_from(); $headers['To'] = trim($object->address); // TRANS: Subject for confirmation e-mail. // TRANS: %s is the StatusNet sitename. $headers['Subject'] = $subject; $headers['Content-Type'] = 'text/html; charset=UTF-8'; $confirmUrl = common_local_url('register', array('code' => $object->code)); $template = DocFile::forTitle($title, DocFile::mailPaths()); $blankfillers = array('confirmurl' => $confirmUrl); if ($type == UserInviteReminderHandler::INVITE_REMINDER) { $blankfillers['inviter'] = $inviter; $blankfillers['inviterurl'] = $inviterUrl; // @todo private invitation message? } $body = $template->toHTML($blankfillers); return mail_send($recipients, $headers, $body); }
$tglskrg = date('Y-m-d'); $statusdefault = getstatusdefault(); $hasil2 = $koneksi_db->sql_query("INSERT INTO transmaster VALUES ('','{$tglskrg}','{$lastid}','{$idcustomer}','{$calculateberat}','{$calculate}','','','{$statusdefault}')"); $idtrans = mysql_insert_id(); if (is_array(@$_SESSION['product_id']) && count(@$_SESSION['product_id']) >= 1) { foreach ($_SESSION['product_id'] as $key => $val) { $id = $_SESSION['product_id'][$key]['product_id']; $jumlah = $_SESSION['product_id'][$key]['jumlah']; $total = $_SESSION['product_id'][$key]['total']; $hasil3 = $koneksi_db->sql_query("INSERT INTO transdetail VALUES ('','{$idtrans}','{$id}','{$jumlah}')"); } } $subject1 = "Ada Pemesan Baru dari " . $nama; $subject2 = "Data Pemesanan Anda di " . $judul_situs; mail_send($email_master, $email, $subject1, $send_admin, 1, 1); mail_send($email, $email_master, $subject2, $send_user, 1, 1); Posted('checkout'); //$tengah ='<div class="sukses">'.$pesancheckout.'</div>'; unset($nama); unset($email); unset($alamat); unset($keterangan); unset($kota); unset($provinsi); unset($kodepos); unset($telp); unset($_SESSION["product_id"]); //session_unregister ('product_id'); Header("Location: sukses.html"); } }
/** * Send a mail to commenter and let her login */ function send_optin_mail($mail, $key) { global $conf; $text = io_readFile($this->localFN('optinmail')); $title = sprintf($this->getLang('optin_subject')); $repl = array('@TITLE@' => $conf['title'], '@URL@' => wl('', array('btngo' => $key), true), '@DOKUWIKIURL@' => DOKU_URL); $text = str_replace(array_keys($repl), array_values($repl), $text); mail_send($mail, $title, $text, $conf['mailfrom']); }
mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); mail_send("*****@*****.**"); }
function lostPasswordAction() { $html = ''; $errors = array(); $is_posted = request_int('is_posted'); $jump_to = 'lost_password_email'; if ($is_posted) { // $captcha_code = request_str('captcha_code'); if (!count($errors) && !request_str('email')) { $errors[] = s('Пожалуйста, укажите e-mail.'); } $email = request_str('email'); if (!count($errors)) { if (($user = core::$sql->row('id, password', DB . 'user', 'email=' . core::$sql->s($email) . ' and id<>' . core::$sql->i(User::ANONIMOUS) . ' and is_disabled=0')) === false) { $errors[] = s('Пользователь с таким e-mail адресом не зарегистрирован.'); } } // if(captcha_compare(request_str('captcha_code'))) { // captcha_close(); if (!count($errors)) { $hash = core::$user->getHash(core::$config['user']['lost_password_salt'], $user['password']); $template_vars = array('{site_url}' => core::$config['site']['url'], '{site_title}' => core::$config['site']['title'], '{site_email}' => core::$config['site']['email'], '{change_password_url}' => 'http://' . core::$config['http_domain'] . '/' . core::$config['current_language'] . '/lost_password/change/?id=' . $user['id'] . '&code=' . $hash); $message = str_replace(array_keys($template_vars), array_values($template_vars), s('Здравствуйте! Ваш адрес был указан при запросе смены пароля на сайте {site_url} Если вы не делали такой запрос проигнорируйте это письмо. Для смены пароля перейдите по ссылке: {change_password_url} C уважением, Администрация сайта {site_title} {site_email} ')); mail_send(core::$config['site']['email_title'], core::$config['site']['email'], $email, s('Смена пароля'), $message); go(core::$config['http_home'] . 'lost_password/sent/'); } // } // else // $errors []= 'Неверный код подтверждения'; } $page = new PageCommon(s('Забыли пароль?')); $html .= $page->start(); $html .= '<div class="row"><div class="col-md-offset-4 col-md-4"><h2>' . s('Забыли пароль?') . '</h2>'; if (count($errors)) { $html .= '<div class="alert alert-danger"><p>' . escape($errors[0]) . '</p></div>'; } $form = new Form('lost_password', false, 'post'); $html .= '<div class="well">' . $form->start() . $form->addVariable('is_posted', 1) . $form->addString('email', s('E-mail'), $is_posted ? request_str('email') : '', array('is_required' => true)) . $form->submit(s('Восстановить пароль')) . '</div>'; /* $html .= '<ul> <li><a href="'.core::$config['http_home'].'login/">'.s('Вход для зарегистрированных').'</a></li> </ul>'; */ $html .= '<script> $(document).ready(function() { $("#' . $jump_to . '").focus(); }); </script>'; $html .= '</div></div>'; $html .= $page->stop(); return $html; }
/** * Verify and send email content.´ */ protected function _send_contact($captcha=false){ global $conf; global $auth; $lang = $this->getLang("error"); require_once(DOKU_INC.'inc/mail.php'); $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $comment = $name."\r\n"; $comment .= $email."\r\n\n"; $comment .= $_POST['content']; if (isset($_REQUEST['to'])){ //multiple targets/profils possible for the email $usersList = explode(',',$_POST['to']); foreach($usersList as $userId){ $user = $auth->getUserData($userId); if (isset($user)) { if (!empty($to)){ $to .= ",".$user['mail']; }else{ $to = $user['mail']; } } } } else { $to = $this->getConf('default'); } // name entered? if(strlen($name) < 2) $this->_set_error('name', $lang["name"]); // email correctly entered? if(!$this->_check_email_address($email)) $this->_set_error('email', $lang["email"]); // comment entered? if(strlen($_POST['content']) < 10) $this->_set_error('content', $lang["content"]); // checks recaptcha answer if($conf['plugin']['moderncontact']['captcha'] == 1 && $captcha == true) { $resp = recaptcha_check_answer ($conf['plugin']['moderncontact']['recaptchasecret'], $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid){ $this->_set_error('captcha', $lang["captcha"]); } } // A bunch of tests to make sure it's legitimate mail and not spoofed // This should make it not very easy to do injection if (eregi("\r",$name) || eregi("\n",$name) || eregi("MIME-Version: ",$name) || eregi("Content-Type: ",$name)){ $this->_set_error('name', $lang["valid_name"]); } if (eregi("\r",$email) || eregi("\n",$email) || eregi("MIME-Version: ",$email || eregi("Content-Type: ",$email))){ $this->_set_error('email', $lang["valid_email"]); } if (eregi("\r",$subject) || eregi("\n",$subject) || eregi("MIME-Version: ",$subject) || eregi("Content-Type: ",$subject)){ $this->_set_error('subject', $lang["valid_subject"]); } if (eregi("\r",$to) || eregi("\n",$to) || eregi("MIME-Version: ",$to) || eregi("Content-Type: ",$to)){ $this->_set_error('to', $lang["valid_to"]); } if (eregi("MIME-Version: ",$comment) || eregi("Content-Type: ",$comment)){ $this->_set_error('content', $lang["valid_content"]); } // Status has not changed. if($this->status != 0) { // send only if comment is not empty // this should never be the case anyway because the form has // validation to ensure a non-empty comment if (trim($comment, " \t") != ''){ if (mail_send($to, $subject, $comment, $email, '', '', 'Reply-to: '.$email)){ $this->statusMessage = $this->getLang("success"); } else { $this->_set_error('unknown', $lang["unknown"]); } //we're using the included mail_send command because it's //already there and it's easy to use and it works } } return true; }
/** * Helper function for sending a mail * * @param string $subscriber_mail The target mail address * @param array $replaces Predefined parameters used to parse the * template * @param string $subject The lang id of the mail subject (without the * prefix “mail_”) * @param string $id The page or namespace id * @param string $template The name of the mail template * * @author Adrian Lang <*****@*****.**> */ function subscription_send($subscriber_mail, $replaces, $subject, $id, $template) { global $conf; $text = rawLocale($template); $replaces = array_merge($replaces, array('TITLE' => $conf['title'], 'DOKUWIKIURL' => DOKU_URL, 'PAGE' => $id)); foreach ($replaces as $key => $substitution) { $text = str_replace('@' . strtoupper($key) . '@', $substitution, $text); } global $lang; $subject = $lang['mail_' . $subject] . ' ' . $id; mail_send('', '[' . $conf['title'] . '] ' . $subject, $text, $conf['mailfrom'], '', $subscriber_mail); }
if (!$pesan) { $error .= "Error: Please enter a message!<br />"; } // $code = substr(hexdec(md5("".date("F j")."".$_POST['random_num']."".$sitekey."")), 2, 6); if ($gfx_check != $_SESSION['Var_session'] or !isset($_SESSION['Var_session'])) { $error .= "Security Code Invalid <br />"; } /*if (cek_posted('contact')){ $error .= 'Anda Telah Memposting, Tunggu beberapa Saat'; }*/ if ($error) { $tengah .= '<div class="error">' . $error . '</div>'; } else { $subject = "{$judul_situs} - Contact Form"; $msg = "\n{$judul_situs} - Contact Form\n\nNama Pengirim: {$nama} <br />\nEmail Pengirim: {$email} <br />\nPesan: {$pesan}\n"; mail_send($email_master, $email, $subject, $msg, 1, 1); // Posted('contact'); $tengah .= '<div class="sukses">Thank you, mail has been sent!</div>'; unset($nama); unset($email); unset($pesan); } } $nama = !isset($nama) ? '' : $nama; $email = !isset($email) ? '' : $email; $pesan = !isset($pesan) ? '' : $pesan; $tengah .= "<div class='bs-callout-info'>\n<table width='100%'><tr><td valign='top'>\n"; $tengah .= "\n<h3 class='judulberita2'>SMA Katolik St. Louis 1 (a.k.a Sinlui)</h3>\nJl. Polisi Istimewa 7<br>\nSurabaya, Jawa Timur, Indonesia.<br>\n031-567.6522 – office@smakstlouis1sby.sch.id<br>\n@stlouissby<br>\n</td><td align='right'><a href='https://www.google.co.id/maps/place/St.+Louis/@-7.2801983,112.7408785,17z/data=!4m2!3m1!1s0x0:0xc8ad65adc027ffba?hl=en' target='new' title='Klik untuk menuju Google MAP' >\n<img src='images/mapstlouis.jpg' height='auto'width='400px'></a>\n</td></tr></table>\n</div>"; /* $tengah.=" $alamatkantor<br>
/** * Send notification emails to group administrator. * * @param User_group $group * @param Profile $joiner */ function mail_notify_group_join_pending($group, $joiner) { $admin = $group->getAdmins(); while ($admin->fetch()) { // We need a local user for email notifications... $adminUser = User::staticGet('id', $admin->id); // @fixme check for email preference? if ($adminUser && $adminUser->email) { // use the recipient's localization common_switch_locale($adminUser->language); $headers = _mail_prepare_headers('join', $admin->nickname, $joiner->nickname); $headers['From'] = mail_notify_from(); $headers['To'] = $admin->getBestName() . ' <' . $adminUser->email . '>'; // TRANS: Subject of pending group join request notification e-mail. // TRANS: %1$s is the joining user's nickname, %2$s is the group name, and %3$s is the StatusNet sitename. $headers['Subject'] = sprintf(_('%1$s wants to join your group %2$s on %3$s.'), $joiner->getBestName(), $group->getBestName(), common_config('site', 'name')); // TRANS: Main body of pending group join request notification e-mail. // TRANS: %1$s is the subscriber's long name, %2$s is the group name, and %3$s is the StatusNet sitename, // TRANS: %4$s is the URL to the moderation queue page. $body = sprintf(_('%1$s would like to join your group %2$s on %3$s. ' . 'You may approve or reject their group membership at %4$s'), $joiner->getFancyName(), $group->getFancyName(), common_config('site', 'name'), common_local_url('groupqueue', array('nickname' => $group->nickname))) . mail_profile_block($joiner) . mail_footer_block(); // reset localization common_switch_locale(); mail_send($adminUser->email, $headers, $body); } } }
$fname = text_filter($_POST['fname']); if (!$fname) { $error .= "Error: Please enter your Frind's Name!<br />"; } if (!$yname) { $error .= "Error: Please enter your Name!<br />"; } $gfx_check = intval($_POST['gfx_check']); if ($_POST['gfx_check'] != $_SESSION['Var_session'] or !isset($_SESSION['Var_session'])) { $error .= "Error: Security Code Invalid <br />"; } if ($error) { $tengah .= '<div class="error">' . $error . '</div>'; } else { $subject = "Ada artikel bagus di {$url_situs}"; $full_pesan = "Hallo,\n\nBerikut ini ada artikel yang bagus untuk dibaca,\n<br />Artikel dengan judul : {$judul_artikel}, silahkan klik aja <a href='{$url_situs}/?pilih=news&mod=yes&aksi=lihat&id={$id}'>{$url_situs}/?pilih=news&mod=yes&aksi=lihat&id={$id}</a>.\n<br />\n<br />\n{$pesan}\n<br />\n<br />Terima kasih."; mail_send($femail, $yemail, $subject, $full_pesan, 0, 3); $tengah .= '<div class="sukses"><p>Pesan Anda telah dikirim ke teman Anda.<br />Terima kasih mau mendistribusikan artikel di situs ini.</p></div>'; $tengah .= '<meta http-equiv="refresh" content="3; url=?pilih=news&mod=yes&aksi=lihat&id=' . $id . '">'; } } $tengah .= '<div class="border">'; $tengah .= "\n<form method=\"post\" action=\"\">\n<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" align=\"center\">\n <tr>\n <td valign=\"top\">Your Name</td>\n <td valign=\"top\">:</td>\n <td valign=\"top\"><input type=\"text\" name=\"yname\" style=\"width:150px\" size=\"50\" /></td>\n </tr>\n <tr>\n <td valign=\"top\">Your E-mail</td>\n <td valign=\"top\">:</td>\n <td valign=\"top\"><input type=\"text\" name=\"yemail\" style=\"width:150px\" size=\"50\" /></td>\n </tr>\n <tr>\n <td valign=\"top\">Your Friend's Name</td>\n <td valign=\"top\">:</td>\n <td valign=\"top\"><input type=\"text\" name=\"fname\" style=\"width:150px\" size=\"50\" /></td>\n </tr>\n <tr>\n <td valign=\"top\">Your Friend's E-Mail</td>\n <td valign=\"top\">:</td>\n <td valign=\"top\"><input type=\"text\" name=\"femail\" style=\"width:150px\" size=\"50\" /></td>\n </tr>\n <tr>\n <td valign=\"top\">Message (option)</td>\n <td valign=\"top\">:</td>\n <td valign=\"top\"><textarea name=\"pesan\" cols=\"50\" rows=\"10\" style=\"width:250px\"></textarea></td>\n </tr>"; if (extension_loaded("gd")) { $random_num = gen_pass(10); $tengah .= "\n <tr>\n <td valign=\"top\">Security Code</td>\n <td valign=\"top\">:</td>\n <td valign=\"top\"><img src=\"{web}/includes/code_image.php\" border=\"1\" alt=\"Security Code\" /></td>\n </tr>\n <tr>\n <td valign=\"top\">Type Code</td>\n <td valign=\"top\">:</td>\n <td valign=\"top\"><input type=\"text\" name=\"gfx_check\" size=\"10\" maxlength=\"6\" /></td>\n </tr>"; } $tengah .= "\n <tr>\n <td valign=\"top\"></td>\n <td valign=\"top\"></td>\n <td valign=\"top\"></td>\n </tr>\n <tr>\n <td valign=\"top\"></td>\n <td valign=\"top\"></td>\n <td valign=\"top\"><input type=\"submit\" name=\"submit\" value=\"Submit\" /></td>\n </tr>\n</table>\n</form>"; $tengah .= '</div>'; } echo $tengah;
/** * @param string $letter Letter html content * @param string $recipient email recipient * @param string $from Sender email * @param string $subject Email subject * @param string $user Sender name */ public function sendEmail($letter, $recipient = '', $from = '', $subject = '', $user = '') { mail_send($recipient, $from, $letter, $subject, $user); }
/** * send a message to confirm a claim for an SMS number * * @param string $code confirmation code * @param string $nickname nickname of user claiming number * @param string $address email address to send the confirmation to * * @see common_confirmation_code() * * @return void */ function mail_confirm_sms($code, $nickname, $address) { $recipients = $address; $headers['From'] = mail_notify_from(); $headers['To'] = $nickname . ' <' . $address . '>'; $headers['Subject'] = _('SMS confirmation'); // FIXME: I18N $body = "{$nickname}: confirm you own this phone number with this code:"; $body .= "\n\n"; $body .= $code; $body .= "\n\n"; mail_send($recipients, $headers, $body); }
/** * Sends a notify mail on page change or registration * * @param string $id The changed page * @param string $who Who to notify (admin|subscribers|register) * @param int $rev Old page revision * @param string $summary What changed * @param boolean $minor Is this a minor edit? * @param array $replace Additional string substitutions, @KEY@ to be replaced by value * * @author Andreas Gohr <*****@*****.**> */ function notify($id, $who, $rev = '', $summary = '', $minor = false, $replace = array()) { global $lang; global $conf; global $INFO; // decide if there is something to do if ($who == 'admin') { if (empty($conf['notify'])) { return; } //notify enabled? $text = rawLocale('mailtext'); $to = $conf['notify']; $bcc = ''; } elseif ($who == 'subscribers') { if (!$conf['subscribers']) { return; } //subscribers enabled? if ($conf['useacl'] && $_SERVER['REMOTE_USER'] && $minor) { return; } //skip minors $data = array('id' => $id, 'addresslist' => '', 'self' => false); trigger_event('COMMON_NOTIFY_ADDRESSLIST', $data, 'subscription_addresslist'); $bcc = $data['addresslist']; if (empty($bcc)) { return; } $to = ''; $text = rawLocale('subscr_single'); } elseif ($who == 'register') { if (empty($conf['registernotify'])) { return; } $text = rawLocale('registermail'); $to = $conf['registernotify']; $bcc = ''; } else { return; //just to be safe } $ip = clientIP(); $text = str_replace('@DATE@', dformat(), $text); $text = str_replace('@BROWSER@', $_SERVER['HTTP_USER_AGENT'], $text); $text = str_replace('@IPADDRESS@', $ip, $text); $text = str_replace('@HOSTNAME@', gethostsbyaddrs($ip), $text); $text = str_replace('@NEWPAGE@', wl($id, '', true, '&'), $text); $text = str_replace('@PAGE@', $id, $text); $text = str_replace('@TITLE@', $conf['title'], $text); $text = str_replace('@DOKUWIKIURL@', DOKU_URL, $text); $text = str_replace('@SUMMARY@', $summary, $text); $text = str_replace('@USER@', $_SERVER['REMOTE_USER'], $text); $text = str_replace('@NAME@', $INFO['userinfo']['name'], $text); $text = str_replace('@MAIL@', $INFO['userinfo']['mail'], $text); foreach ($replace as $key => $substitution) { $text = str_replace('@' . strtoupper($key) . '@', $substitution, $text); } if ($who == 'register') { $subject = $lang['mail_new_user'] . ' ' . $summary; } elseif ($rev) { $subject = $lang['mail_changed'] . ' ' . $id; $text = str_replace('@OLDPAGE@', wl($id, "rev={$rev}", true, '&'), $text); $df = new Diff(explode("\n", rawWiki($id, $rev)), explode("\n", rawWiki($id))); $dformat = new UnifiedDiffFormatter(); $diff = $dformat->format($df); } else { $subject = $lang['mail_newpage'] . ' ' . $id; $text = str_replace('@OLDPAGE@', 'none', $text); $diff = rawWiki($id); } $text = str_replace('@DIFF@', $diff, $text); if (utf8_strlen($conf['title']) < 20) { $subject = '[' . $conf['title'] . '] ' . $subject; } else { $subject = '[' . utf8_substr($conf['title'], 0, 20) . '...] ' . $subject; } mail_send($to, $subject, $text, $conf['mailfrom'], '', $bcc); }