Example #1
0
        $headers .= "Content-Type: multipart/mixed;\n";
        $headers .= " boundary=\"==Multipart_Boundary_x000x\"";
        // text
        $body = "This is a multi-part message in MIME format.\n\n";
        $body .= "--==Multipart_Boundary_x000x\n";
        $body .= "Content-Type: text/plain; charset=UTF-8\n";
        $body .= "Content-Transfer-Encoding: 7bit\n\n";
        $body .= "\n{$text}\n";
        // priloha
        if ($att == true) {
            $body .= "--==Multipart_Boundary_x000x\n";
            $body .= "Content-Type: {application/octet-stream};\n";
            $body .= " name=\"{$att_name}\"\n";
            $body .= "Content-Transfer-Encoding: base64\n\n";
            $body .= $att_content . "\n\n";
        }
        // odeslani
        if (_mail($receiver, $subject, $body, $headers)) {
            $return = 1;
        } else {
            $return = 3;
        }
    } else {
        $return = 2;
    }
} else {
    $return = 4;
}
// presmerovani zpet
$_GET['_return'] = _addGetToLink($_GET['_return'], "hcm_mr_" . $fid . "=" . $return . "#hcm_mform_" . $fid, false);
_returnHeader();
Example #2
0
 $sent = false;
 if (isset($_POST['username'])) {
     if (_iplogCheck(7)) {
         // nacteni promennych
         $username = _anchorStr($_POST['username'], false);
         $email = DB::esc($_POST['email']);
         // kontrola promennych
         if (_captchaCheck()) {
             $userdata = DB::query("SELECT email,password,salt,username FROM `" . _mysql_prefix . "-users` WHERE username='******' AND email='" . $email . "'");
             if (DB::size($userdata) != 0) {
                 // odeslani emailu
                 $userdata = DB::row($userdata);
                 $link = _url . "/index.php?m=lostpass&link&user="******"&hash=" . md5($userdata['email'] . $userdata['salt'] . $userdata['password']);
                 $text_tags = array("*domain*", "*username*", "*link*", "*date*", "*ip*");
                 $text_contents = array(_getDomain(), $userdata['username'], $link, _formatTime(time()), _userip);
                 if (_mail($userdata['email'], str_replace('*domain*', _getDomain(), $_lang['mod.lostpass.mail.subject']), str_replace($text_tags, $text_contents, $_lang['mod.lostpass.mail.text']), "Content-Type: text/plain; charset=UTF-8\n" . _sysMailHeader())) {
                     $module .= _formMessage(1, $_lang['mod.lostpass.cmailsent']);
                     _iplogUpdate(7);
                     $sent = true;
                 } else {
                     $module .= _formMessage(3, $_lang['hcm.mailform.msg.failure2']);
                 }
             } else {
                 $module .= _formMessage(2, $_lang['mod.lostpass.notfound']);
             }
         } else {
             $module .= _formMessage(2, $_lang['captcha.failure2']);
         }
     } else {
         $module .= _formMessage(3, str_replace('*limit*', _lostpassexpire / 60, $_lang['mod.lostpass.limit']));
     }
     $notice = str_replace('*domain*', _getDomain(), $_lang['admin.other.massemail.emailnotice']);
     if ($ctype == 1) {
         $notice = "\n\n\n-------------------------------------\n" . $notice;
     } else {
         $notice = "<br><br><hr><p><small>" . _htmlStr($notice) . "</small></p>";
     }
     $text .= $notice;
     // postupne odesilani po skupinach
     $done = 0;
     while ($item = DB::row($query)) {
         $rec_buffer[] = $item['email'];
         ++$rec_buffer_counter;
         ++$item_counter;
         if ($rec_buffer_counter === $rec_buffer_size || $item_counter === $item_total) {
             // odeslani emailu
             if (_mail('', $subject, $text, "Bcc: " . implode(",", $rec_buffer) . "\n" . $headers)) {
                 $done += sizeof($rec_buffer);
             }
             $rec_buffer = array();
             $rec_buffer_counter = 0;
         }
     }
     // zprava
     if ($done != 0) {
         $output .= _formMessage(1, str_replace(array("*done*", "*total*"), array($done, $item_total), $_lang['admin.other.massemail.send']));
     } else {
         $output .= _formMessage(2, $_lang['admin.other.massemail.noreceiversfound']);
     }
 } else {
     // vypis emailu
     $emails_total = DB::size($query);
Example #4
0
                } else {
                    mysql_query("UPDATE user SET password = '******' WHERE `id` = " . $user_id);
                    echo '<p class="okay">
						' . _('Das Passwort wurde geändert.') . '
					</p>';
                }
            }
            if ($_POST['mail'] != $me->mail) {
                if (preg_match('/^[a-z0-9.\\-+_]+@[a-z0-9.\\-+_]+\\.[a-z]+$/i', $_POST['mail']) == 0) {
                    echo '<p class="error">
						' . sprintf(_('„%s“ ist keine gültige E-Mail-Adresse. Wenn du das anders siehst, kontaktiere uns bitte.'), htmlspecialchars($_POST['mail'])) . '
					</p>';
                } else {
                    _mail($_POST['mail'], '[' . $title . '] ' . _('Bestätigung der Änderung der E-Mail-Adresse'), sprintf(_('Hallo!
jemand möchte seine im %s angegebene E-Mailadresse zu dieser ändern.
Wenn du das warst, klicke bitte untenstehenden Link an. Wenn nicht,
ignoriere diese E-Mail einfach.

%s'), $title, $mainurl . "setmail.php?user="******"&mail=" . urlencode($_POST['mail']) . "&hash=" . sha1($me->id . $secret . "CHANGEMAIL" . $_POST['mail'])), 'From: ' . $mailsender);
                    echo '<p class="okay">';
                    printf(_('Es wurde eine Bestätigung zur Änderung der Mailadresse an %s versandt.'), htmlspecialchars($_POST['mail']));
                    echo '</p>';
                }
            }
        } else {
            echo '<p class="error">
				' . _('Das aktuelle Passwort wurde nicht korrekt eingegeben!') . '
			</p>';
        }
    }
    if (isset($_POST['locale'])) {
        if (in_array($_POST['locale'], $locales)) {
<?php

function _mail($from, $to, $subj, $what)
{
    return mail($to, $subj, $what, "From: {$from}\n\tReply-To: {$from}\n\tContent-Type: text/plain; charset=windows-1251\n\tContent-Transfer-Encoding: 8bit");
}
if (strtolower($_SERVER['REQUEST_METHOD']) != 'post') {
    die('unsupported');
}
$options1 = array('options' => array('regexp' => '/^[А-Яа-яЁёA-Za-z0-9 .\\-]+$/iu'));
$email = $_POST['email'];
if ($email === FALSE) {
    $status = 'invalid';
} else {
    $subscribe_str = $subscribe ? 'Да' : 'Нет';
    $destination_mail = '*****@*****.**';
    $theme = 'Подписка на новости о Ёлке';
    $message = "Почта: {$email}";
    $status = _mail("*****@*****.**", $destination_mail, $theme, $message) ? 'success' : 'error';
}
$invalid = array();
if (!$email) {
    $invalid[] = 'email';
}
$data = array('status' => $status, 'invalid' => $invalid);
header('Content-Type: application/json');
echo json_encode($data);
Example #6
0
                    $("#call_status_img").html('<i class="fa fa-exclamation-triangle"></i> OFF');
                    $("#call_status_img").css("background-color","#CC1E1E");
                    $("#call_status_img").attr("onclick","changeCallStatus('off')");
                }else{
                    $("#call_status_img").html('<i class="fa fa-check"></i> ON');
                    $("#call_status_img").css("background-color","#39891D");
                    $("#call_status_img").attr("onclick","changeCallStatus('on')");
                }
                $.ajax({
                url: _U + 'call_report',
                data: {change_call_status: 1,curr_status:curr_status},
                success: function (r) {
                
                }
            });
            }
        </script>
    </body>
</html>
<?php 
if (isset($_mail_send_arr) && !empty($_mail_send_arr)) {
    if (!empty($_mail_send_arr['to'])) {
        if (isset($_mail_send_arr['from_email']) && trim($_mail_send_arr['from_email']) != '') {
            $mail_from_info['name'] = trim($_mail_send_arr['from_name']);
            $mail_from_info['email'] = trim($_mail_send_arr['from_email']);
            $mail_res = _mail_with_from($_mail_send_arr['to'], $_mail_send_arr['subject'], $_mail_send_arr['content'], $mail_from_info);
        } else {
            $mail_res = _mail($_mail_send_arr['to'], $_mail_send_arr['subject'], $_mail_send_arr['content']);
        }
    }
}
Example #7
0
        require 'includes/login_footer.php';
        exit;
    }
}
if ($_POST['username']) {
    $q = mysql_query('SELECT mail, id FROM user WHERE (mail = "' . mysql_real_escape_string($_POST['username']) . '" and mail != "") OR name = "' . mysql_real_escape_string($_POST['username']) . '"');
    if (mysql_num_rows($q) == 1) {
        $me = mysql_fetch_object($q);
        if (strpos($me->mail, '@') === false) {
            echo "<div style='text-align: center' class='wrongpw'>" . _('Dieser Benutzer wurde ohne E-Mail-Adresse registriert. Tut uns leid, aber jetzt können wir auch nichts mehr machen!') . "</div>";
        } else {
            echo "<div style='text-align: center' class='okay'>" . _("Du hast per E-Mail weitere Anweisungen erhalten!") . "</div>";
            _mail($me->mail, '[' . $title . '] ' . _('Passwort vergessen?'), sprintf(_('Hallo!
du hast im %s ein neues Passwort angefordert!
Wenn du das wirklich selbst warst, klicke auf untenstehenden Link. Wenn das
jemand anderes gewesen sein muss, brauchst du diese E-Mail nur zu ignorieren.
Achtung! Der Link gilt nur bis heute abend, 23:59!

%s'), $title, $mainurl . "lostpw.php?user="******"&hash=" . sha1($me->id . $secret . "NEWPW" . date("d.m.Y"))), 'From: ' . $mailsender);
        }
    } else {
        echo "<div style='text-align: center' class='wrongpw'>" . _('Es tut uns leid, aber diesen Nutzer haben wir leider nicht im System!') . "</div>";
    }
}
?>

<div id="header"></div>
<div id="content">
	<h2><?php 
echo _('Passwort vergessen?');
?>
Example #8
0
    $channel = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannel($channel_id);
    if (empty($channel['channel_story_url'])) {
        $story_url = Horde::url('stories/view.php', true)->add(array('channel_id' => '%c', 'id' => '%s'));
    } else {
        $story_url = $channel['channel_story_url'];
    }
    $story_url = str_replace(array('%25c', '%25s'), array('%c', '%s'), $story_url);
    $story_url = str_replace(array('%c', '%s', '&amp;'), array($channel_id, $story['id'], '&'), $story_url);
    if ($info['include'] == 0) {
        require_once 'Horde/MIME/Part.php';
        /* TODO: Create a "URL link" MIME part instead. */
        $message_part = new MIME_Part('text/plain');
        $message_part->setContents($message_part->replaceEOL($story_url));
        $message_part->setDescription(_("Story Link"));
    } else {
        $message_part = Jonah::getStoryAsMessage($story);
    }
    $result = _mail($message_part, $info['from'], $info['recipients'], $info['subject'], $info['message']);
    if (is_a($result, 'PEAR_Error')) {
        $notification->push(sprintf(_("Unable to send story: %s"), $result->getMessage()), 'horde.error');
    } else {
        $notification->push(_("The story was sent successfully."), 'horde.success');
        header('Location: ' . $story_url);
        exit;
    }
}
$page_output->topbar = $page_output->sidebar = false;
$page_output->header(array('title' => $title));
$notification->notify(array('listeners' => 'status'));
$form->renderActive(null, $vars, Horde::url('stories/share.php'), 'post');
$page_output->footer();
Example #9
0
        }
    } else {
        $group = _defaultgroup;
    }
    if (SL::$settings['rules'] != "" and !_checkboxLoad("agreement")) {
        $errors[] = $_lang['mod.reg.rules.disagreed'];
    }
    // vlozeni do databaze nebo seznam chyb
    if (count($errors) == 0) {
        _iplogUpdate(5);
        $code = _tmpRegister(_registration_confirm, $group, $username, $password, $massemail, _userip, $email);
        if (isset($code)) {
            // poslat potvrzeni
            $phase = 2;
            $domain = _getDomain();
            $mail = _mail($email, str_replace('*domain*', $domain, $_lang['mod.reg.confirm.subject']), str_replace(array('*username*', '*domain*', '*url*', '*ip*', '*date*', '*code*'), array($username, $domain, _url, _userip, _formatTime(time()), $code), $_lang['mod.reg.confirm.text']), "Content-Type: text/plain; charset=UTF-8\n" . _sysMailHeader());
        } else {
            // registrace ok
            $phase = 1;
        }
    } else {
        $message = _formMessage(2, _eventList($errors, 'errors'));
    }
}
/* ---  modul  --- */
if (_template_autoheadings == 1) {
    $module .= "<h1>" . $_lang['mod.reg'] . "</h1>";
}
switch ($phase) {
    // registracni formular
    case 0:
Example #10
0
// $bcc = '*****@*****.**' ;
$bcc = '';
$subject = 'You received a new voicemail!';
// here document for body
$body = <<<EOM
Dear Name,

You have a new voicemail.

See the attached file.

Sincerely,
The voicemail droid

EOM;
$return = _mail($sender, $recipient, $cc, $bcc, $subject, $body, $file);
// status message
if ($return) {
    ?>
Message from <?php 
    echo $sender;
    ?>
 to <?php 
    echo $recipient;
    ?>
 re: "<?php 
    echo $subject;
    ?>
" sent successfully.
<?php 
} else {
Example #11
0
/**
 * 
 * Alert the dispatcher for events
 * 
 * @param type $type
 * @param type $data
 */
function _notifyDispatcher($type, $data)
{
    switch ($type) {
        case "POSITIVE_CONFIRMATION":
            # $data is a row from tripconfirmationtexts
            # we need : driver name , triptime simple
            // send driver special requests
            Schedulers::sendTripNotesToDriver($data['tripCode']);
            $driverName = $data['driverName'];
            $tripTime = date("H:i", strtotime($data['tripTime']));
            $tripDate = date("m/d", strtotime($data['tripTime']));
            $subject = "{$driverName} confirmed wakeup text for trip at {$tripTime}";
            $content = "Trip Info: {$tripDate} {$tripTime} - {$data['passengerFirstName']} {$data['passengerLastName']} - {$data['carName']} - {$data['vehicleType']}";
            $wakeup_notification = Config::GetEmailValue('wakeup_confirmation_email_notification');
            $wakeup_notification_emails = plainArray($wakeup_notification, 'value');
            _mail($wakeup_notification_emails, $subject, $content);
            break;
        case "PROACTIVE_HALT":
            # $data is a row from tripconfirmationtexts
            # we need : driver name , triptime simple
            // Send trip notes to driver upon confirmation
            Schedulers::sendTripNotesToDriver($data['tripCode']);
            $driverName = $data['driverName'];
            $tripTime = date("H:i", strtotime($data['tripTime']));
            $tripDate = date("m/d", strtotime($data['tripTime']));
            $haltTime = date("H:i");
            $subject = "{$driverName} checked in for {$tripTime} trip - {$data['passengerFirstName']} {$data['passengerLastName']}";
            $content = "Trip Info: {$tripDate} {$tripTime} - {$data['passengerFirstName']} {$data['passengerLastName']} - {$data['carName']} - {$data['vehicleType']}";
            $wakeup_notification = Config::GetEmailValue('wakeup_confirmation_email_notification');
            $wakeup_notification_emails = plainArray($wakeup_notification, 'value');
            _mail($wakeup_notification_emails, $subject, $content);
            break;
        case "DISPATCHER_HANDLED":
            # $data is a row from tripconfirmationtexts
            # we need : driver name , triptime simple
            $driverName = $data['driverName'];
            $dispatchName = $data['dispatcher_name'];
            $tripTime = date("H:i", strtotime($data['tripTime']));
            $tripDate = date("m/d", strtotime($data['tripTime']));
            $subject = "Trip at {$tripTime} was handled by dispatcher {$dispatchName} ";
            $content = "Driver {$driverName} failed to confirm wakeup text. <br /><br />Trip Info: {$tripDate} {$tripTime} - {$data['passengerFirstName']} {$data['passengerLastName']} - {$data['carName']} - {$data['vehicleType']} ";
            $wakeup_notification = Config::GetEmailValue('wakeup_red_alert');
            $wakeup_notification_emails = plainArray($wakeup_notification, 'value');
            _mail($wakeup_notification_emails, $subject, $content);
            break;
        case "NOBODY_HANDLED":
            # $data is a row from tripconfirmationtexts
            # we need : driver name , triptime simple
            $driverName = $data['driverName'];
            $driverNumber = $data['driverNumber'];
            $tripTime = date("H:i", strtotime($data['tripTime']));
            $tripDate = date("m/d", strtotime($data['tripTime']));
            $subject = "RED ALERT! Trip at {$tripTime} is orphan. Nobody is available to handle";
            $content = "Trip Info: {$tripDate} {$tripTime} - {$data['passengerFirstName']} {$data['passengerLastName']} - {$data['carName']} - {$data['vehicleType']}";
            $content .= "<br /><br />Driver Info: Name - {$driverName} | Cell #: {$driverNumber}";
            $wakeup_notification = Config::GetEmailValue('wakeup_red_alert');
            $wakeup_notification_emails = plainArray($wakeup_notification, 'value');
            _mail($wakeup_notification_emails, $subject, $content);
            break;
    }
}