Exemplo n.º 1
0
function sendMail($to, $from, $cc, $bcc, $subject, $html)
{
    $kaikki = array("to", "from", "cc", "bcc", "subject", "html");
    foreach ($kaikki as $x) {
        ${$x} = str_replace('\\', "", html_entity_decode(${$x}, ENT_QUOTES, "UTF-8"));
    }
    $subject = mime_header(str_replace(" ", "_", $subject));
    $from = post_mime_header_explode($from);
    $to = post_mime_header_explode($to);
    $cc = post_mime_header_explode($cc);
    $bcc = post_mime_header_explode($bcc);
    $headers = 'From: ' . mime_header_many($from) . "\r\n";
    //            'Reply-To: ' . mime_header_many($from) . "\r\n";
    if (!empty($cc)) {
        $headers .= 'Cc: ' . mime_header_many($cc) . "\r\n";
    }
    if (!empty($bcc)) {
        $headers .= 'Bcc: ' . mime_header_many($bcc) . "\r\n";
    }
    if (!empty($html)) {
        $random_hash = md5(date('r', time()));
        $headers .= 'Content-Type: multipart/alternative; boundary=' . $random_hash;
        $message = "--" . $random_hash . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n" . 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . "\r\n" . wordwrap(mime_header(trim(str_replace("\t", "", strip_tags(str_replace('\\', "", $html))))), 76, "\r\n") . "\r\n" . "\r\n" . "--" . $random_hash . "\r\n" . 'Content-Type: text/html; charset=UTF-8' . "\r\n" . 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . "\r\n" . mime_header($html) . "\r\n" . "\r\n" . "--" . $random_hash . "--" . "\r\n";
    }
    for ($i = 0; $i <= count($to) - 1; $i++) {
        mail_utf8(str_replace('\\', "", mime_header_to($to[$i])), str_replace('\\', "", $subject), str_replace('\\', "", $message), str_replace('\\', "", $headers));
    }
}
Exemplo n.º 2
0
function SendChangeMail($name, $email, $pemail, $ack)
{
    $unitab = LoadUniverse();
    $uni = $unitab['num'];
    $text = "Приветствуем {$name},\n\n" . "временный адрес e-mail Вашего аккаунта в {$uni}-й вселенной был изменён в настройках на {$email}.\n" . "Если Вы его не измените в течение недели, то он станет постоянным.\n\n" . "Чтобы беспрепятственно продолжить игру, подтвердите ваш новый адрес e-mail по следующей ссылке:\n\n" . hostname() . "game/validate.php?ack={$ack}\n\n" . "Ваша команда OGame";
    mail_utf8($pemail, "Ваш игровой электронный адрес изменён ", $text, "From: OGame Uni ru {$uni} <*****@*****.**>");
}
    if ($hash['mond'] != "on" && $hash['elisa'] != "on") {
        err("Please enroll for at least one meeting.");
    }
    $hash['mond'] == "on" ? $mond_checked = "checked" : ($mond_checked = "");
    $hash['elisa'] == "on" ? $elisa_checked = "checked" : ($elisa_checked = "");
    $hash['dinner'] == "on" ? $dinner_checked = "checked" : ($dinner_checked = "");
    $hash['date'] = date("d.m.Y", time());
    if (!$ERROR) {
        $data = get_data();
        $data[] = $hash;
        store_data($data);
        $hash['mond'] == "on" ? $attends_mond = "yes" : ($attends_mond = "no");
        $hash['elisa'] == "on" ? $attends_elisa = "yes" : ($attends_elisa = "no");
        $hash['dinner'] == "on" ? $attends_dinner = "yes" : ($attends_dinner = "no");
        $mailbody = $hash['firstname'] . " " . $hash['lastname'] . " <" . $hash['email'] . "> \n" . $hash['affiliation'] . "\n\nAttended meetings:\nLPF/MoND: {$attends_mond}\neLISA Consortium meeting: {$attends_elisa}\n\nAttends conference dinner: {$attends_dinner}";
        mail_utf8("*****@*****.**", "New Registration: " . $hash['firstname'] . " " . $hash['lastname'], $mailbody);
        print "<center><h3><font color=\"red\">Thank you, you have been registered.</font></h3><br><br>You can find a list of hotels on the <a href=\"index.php?page=accomodation\">accomodation</a> page.</center>";
    }
}
if ($ERROR || !isset($_POST['register'])) {
    ?>

<h2>Registration form</h2>

<table border="0" width="70%">
 <tr>
  <td>
   There is no registration fee. Please tell us if and on what days
   you will attend the meeting, this will help us organizing the lecture halls, coffee breaks, etc.
  </td>
 </tr>
Exemplo n.º 4
0
    errorpage();
}
$ok = false;
if (isset($_POST['send'])) {
    $email = $_POST['lavida_email'];
    if (filter_var($email, FILTER_VALIDATE_EMAIL) == "") {
        echo "<div class=\"alert alert-error\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">x</button><strong>Error!</strong> \"{$email}\" is not validate email.</div>";
    } else {
        $sql = "select count(*) from `users` where `email`='{$email}' and `user_id`<>'{$user}'";
        $tmp = @mysql_query($sql);
        $res = @mysql_fetch_row($tmp);
        if ($res[0] == 0) {
            $code = sha1(time() . " - Espresso Coffee - " . $user);
            $title = "Lavida Online Judge Account Activation Mail";
            $message = "{$user} 님!! 안녕하세요.<br/>" . "본 메일은 Lavida Online Judge 시스템 계정 활성화를 위한 메일입니다.<br/>" . "하단의 링크를 방문하셔서 계정을 활성화 해주시길 바랍니다.<br/>" . "<a href='http://judge.lavida.us/activate/{$code}'>[인증하기]</a><br/>";
            $ok = mail_utf8($email, "administrator", "*****@*****.**", $title, $message);
            //$ok=false;
            if ($ok == true) {
                echo "<div class=\"alert alert-success\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">x</button><strong>Success!</strong> Activation mail has been sent to \"{$email}\"</div>";
                $sql = "insert into activation (user_id,code,time) values('{$user}','{$code}',now())";
                @mysql_query($sql);
                $sql = "update `users` SET `email`='{$email}' where `user_id`='{$user}'";
                @mysql_query($sql);
                session_destroy();
            } else {
                echo "<div class=\"alert alert-error\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">x</button><strong>Error!</strong> Contact Administrator.</div>";
            }
        } else {
            echo "<div class=\"alert alert-error\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">x</button><strong>Error!</strong> {$email} already exists!</div>";
        }
    }
Exemplo n.º 5
0
<?php

error_reporting(0);
$subject = 'Заказ с сайта TeslaWatch';
// Тема письма
$email_from = '*****@*****.**';
// От кого - Мыло
$from_name = 'Сайт TeslaWatch';
// От кого - Имя отправителя
$email_to = 'info@teslawatch.ru,seoschka@yandex.ru,79225555735@ya.ru';
// От кого - Имя отправителя
$order_name = $_REQUEST['name'] ? $_REQUEST['name'] : 'Не указано';
$order_phone = $_REQUEST['phone'] ? $_REQUEST['phone'] : 'Не указано';
$form_name = $_REQUEST['form_name'] ? $_REQUEST['form_name'] : 'Не указано';
$url = $_REQUEST['url'] ? $_REQUEST['url'] : 'Не определено';
$message = '<p>Имя: ' . $order_name . '</p>';
$message .= '<p>Телефон: ' . $order_phone . '</p>';
$message .= '<p>Форма: ' . $form_name . '</p>';
$message .= '<p>URL: ' . $url . '</p>';
if (mail_utf8($email_to, $from_name, $email_from, $subject, $message)) {
    echo '<div class="top_form_head">Спасибо за обращение!</div> <p>Вам позвонят в самое ближайшее время.</p>';
} else {
    echo '<div class="top_form_head">Ошибка отправки сообщения.</div> <p>Пожалуйста обратитесь по телефонам указаным на сайте.</p>';
}
function mail_utf8($to, $from_user, $from_email, $subject = '(No subject)', $message = '')
{
    $from_user = "******" . base64_encode($from_user) . "?=";
    $subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
    $headers = "From: {$from_user} <{$from_email}>\r\n" . "MIME-Version: 1.0" . "\r\n" . "Content-type: text/html; charset=UTF-8" . "\r\n";
    return mail($to, $subject, $message, $headers);
}
Exemplo n.º 6
0
    include_once $_SERVER['DOCUMENT_ROOT'] . '/Contacts/views/building/head.php';
    dump($_SESSION, "SESSION");
    dump($_POST, "POST");
}
$failure = 0;
/*For disable or enable registration.*/
if (1) {
    if (isset($_POST['useremail_1']) && !empty($_POST['useremail_1']) && isset($_POST['useremail_2']) && !empty($_POST['useremail_2']) && isset($_POST['userpass_1']) && !empty($_POST['userpass_1']) && isset($_POST['userpass_2']) && !empty($_POST['userpass_2'])) {
        if ($_POST['useremail_1'] == $_POST['useremail_2'] && $_POST['userpass_1'] == $_POST['userpass_2']) {
            $username = trim($_POST['useremail_1']);
            if (NULL == exists_user(0, $username)) {
                $active = "act" . md5(mt_rand());
                if ($userid = insert_user($username, md5(trim($_POST['userpass_1'])), $_SERVER['REMOTE_ADDR'], $_SERVER['REMOTE_PORT'], $_SERVER['HTTP_USER_AGENT'], $active)) {
                    $url = "" . $_SERVER['SERVER_NAME'] . "contacts/models/user/activation.php?id=" . $userid . "&user="******"&active=" . $active . "";
                    $message = "<h2>Thank you " . $username . " for registering!</h2><hr /><br /><p>Your account is not activated, \n\t\t\t\t\tTo activate click on the following link: </p>" . $url . "<div><sub>Mycnts © 2014<sub></div>";
                    if (mail_utf8($_POST['useremail_1'], "Account validation MyCnts", $message)) {
                        $_SESSION['success'] = ($debug ? "<b>register.php:</b><br />" : "") . "Thanks for signing up! We've sent an email account activation at: <b>'" . $username . "'</b>";
                    } else {
                        $_SESSION['error'] = ($debug ? "<b>register.php:</b><br />" : "") . "Ooops! Something went wrong with sending e-mail!";
                    }
                } else {
                    $failure = 1;
                    $_SESSION['error'] = ($debug ? "<b>register.php:</b><br />" : "") . "Ooops! The registration process failed!";
                }
            } else {
                $failure = 1;
                $_SESSION['warning'] = ($debug ? "<b>register.php:</b><br />" : "") . "The user with e-mail '" . $username . "' already exists, try again with another username!";
            }
        } else {
            $failure = 1;
            $_SESSION['warning'] = ($debug ? "<b>register.php:</b><br />" : "") . "Incorrect keying in confirmation fields, try again!";
Exemplo n.º 7
0
Arquivo: mail.php Projeto: podow/pf
$adminemail = "*****@*****.**";
// e-mail админа
$date = date("d.m.y");
// число.месяц.год
$time = date("H:i");
// часы:минуты:секунды
$sitename = "berdnikov.tk";
//Название сайта
// Принимаем данные с формы
$name = $_POST['name'];
$email = $_POST['email'];
$msg = $_POST['message'];
// Проверяем валидность e-mail
if (!preg_match("|^([a-z0-9_\\.\\-]{1,20})@([a-z0-9\\.\\-]{1,20})\\.([a-z]{2,4})|is", strtolower($email))) {
    echo "<center>Вернитесь\n<a href='javascript:history.back(1)'><b>назад</b></a>.\nВы указали неверные данные!";
} else {
    $msg = "\nНовое сообщение с сайта {$sitename}\nИмя: {$name}\nE-mail: {$email}\nСообщение: {$msg}\n";
    function mail_utf8($to, $subject = 'Портфолио - новая заявка', $message = '', $header = '')
    {
        $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
        mail($to, '=?UTF-8?B?' . base64_encode($subject) . '?=', $message, $header_ . $header);
    }
    if (mail_utf8($adminemail, null, $msg)) {
        print "<script language='Javascript'><!--\n\tfunction reload() {location = \"{$backurl}\"}; setTimeout('reload()', 6000);\n\t//--></script>\n\t{$msg}\n\t<p>Сообщение отправлено! Подождите, сейчас вы будете перенаправлены на главную страницу.</p>";
        exit;
    } else {
        print "<script language='Javascript'><!--\n\tfunction reload() {location = \"{$backurl}\"}; setTimeout('reload()', 6000);\n\t//--></script>\n\t{$msg}\n\t<p>Сообщение не отправлено! Пожалуйста, обновите страницу и попробуйте позже.</p>";
        exit;
    }
}
Exemplo n.º 8
0
                $gallery = GALLERY_;
            }
            setConfig($db, $username, 'gallery', 'root', $gallery);
        }
        // Set Gallery Sorting
        if (GALLERYSORT_ != '-1') {
            if ($sorting == '') {
                $sorting = GALLERYSORT_;
            }
            setConfig($db, $username, 'gallery', 'order', $sorting);
        }
        // Send Email
        $message = MESSAGE_;
        $message = str_replace('[username]', $username, $message);
        $message = str_replace('[password]', $passwd, $message);
        mail_utf8($email, SUBJECT_, $message, 'FROM: ' . SENDER_);
    }
    // Output report
    if (isset($err)) {
        $fail .= $username . ' - ' . $err . "<br>\n";
    } else {
        $success .= $username . "<br>\n";
    }
}
echo "FAILED:<br>\n" . $fail;
echo "<br>\n";
echo "ADDED:<br>\n" . $success;
function validChars($check)
{
    if (preg_match('/[^a-zA-Z0-9 _\\.@\\-]/', $check)) {
        // There are illegal chars
Exemplo n.º 9
0
<?php

function mail_utf8($to, $from_user, $from_email, $subject = '(No subject)', $message = '')
{
    $from_user = "******" . base64_encode($from_user) . "?=";
    $subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
    $headers = "From: {$from_user} <{$from_email}>\r\n" . "MIME-Version: 1.0" . "\r\n" . "Content-type: text/txt; charset=UTF-8" . "\r\n";
    return mail($to, $subject, $message, $headers);
}
//print(var_export($_POST, true));
mail_utf8('*****@*****.**', '*****@*****.**', '*****@*****.**', '[coworking.a-metz.info] Réponse au sondage', var_export($_POST, true));
print '{"result": "ok" }';
Exemplo n.º 10
0
<?php

function mail_utf8($to, $from_user, $from_email, $subject = '(No subject)', $message = '')
{
    $from_user = "******" . base64_encode($from_user) . "?=";
    $subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
    $headers = "From: {$from_user} <{$from_email}>\r\n" . "MIME-Version: 1.0" . "\r\n" . "Content-type: text/html; charset=UTF-8" . "\r\n";
    return mail($to, $subject, $message, $headers);
}
$admin_email = "*****@*****.**";
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$message = "телефон: " . $phone . "<br> email: " . $email . "<br>" . str_replace("\n", "<br>", $_POST['message']);
$isMailed = mail_utf8($admin_email, $name, $email, "Швейное дело - обратная связь с " . $name, $message);
$data = (object) ["email" => $admin_email, "name" => $name, "retEmail" => $email, "phone" => $phone, "message" => $message, "isMailed" => $isMailed];
header('Content-Type: application/json');
echo json_encode($data);
Exemplo n.º 11
0
 * Time: 10:00 PM
 */
defined('_JEXEC') or die('Restricted access');
session_start();
$_SESSION = array();
include_once $_SERVER['DOCUMENT_ROOT'] . '/captcha/simple-php-captcha.php';
$_SESSION['captcha'] = simple_php_captcha();
$registry['contact'] = $DB->getAll("SELECT * FROM #__contact WHERE id=1");
if ($_POST['stage'] == 'process') {
    session_start();
    if (!empty($_POST['name'])) {
        if (email_check($_POST['email'])) {
            if ($_SESSION['captcha']['code'] == $_POST['capcha']) {
                $to = $registry['emailsup'];
                $subject = 'funtime.ge -' . !empty($_POST['subject']) ? $_POST['subject'] : 'კონტაქტი';
                $message = htmlspecialchars($_POST['msg']);
                mail_utf8($registry['contact'][0]['email'], htmlspecialchars($_POST['name']), $_POST['email'], $subject, $message);
                header("location:/com/contacts?success=true");
            } else {
                $message[0] = "error";
                $message[1] = 'შეცდომა თქვენ შეიყვანეთ არასწორი კოდი ფოტოსურათიდან.';
            }
        } else {
            $message[0] = "error";
            $message[1] = 'არასწორი ელ.ფოსტა';
        }
    } else {
        $message[0] = "error";
        $message[1] = 'გთხოვთ მიუთითოთ თქვენი სახელი';
    }
}
Exemplo n.º 12
0
dbquery("SET NAMES 'utf8';");
dbquery("SET CHARACTER SET 'utf8';");
dbquery("SET SESSION collation_connection = 'utf8_general_ci';");
$uni = LoadUniverse();
$uninum = $uni['num'];
$pass_ok = false;
if (method() === "POST") {
    $email = $_POST['email'];
    if (isValidEmail($email)) {
        $user = EmailExist($email);
        if ($user) {
            $pass = gen_trivial_password();
            $md5 = md5($pass . $db_secret);
            $query = "UPDATE " . $db_prefix . "users SET session = '', password = '******' WHERE player_id = " . $user['player_id'];
            dbquery($query);
            mail_utf8($user['pemail'], loca("REG_FORGOT_SUBJ"), va(loca("REG_FORGOT_MAIL"), $user['oname'], $uninum, $pass, "http://" . hostname()), "From: welcome@" . hostname());
            $pass_ok = true;
        }
    }
}
?>

<html> 
 <head> 
  <title><?php 
echo loca("REG_FORGOT_TITLE");
?>
</title> 
<!--  <meta http-equiv="refresh" content="5; URL=http://<?php 
echo hostname();
?>
Exemplo n.º 13
0
<?php

$to_email = "*****@*****.**";
if ($_POST) {
    header('Access-Control-Allow-Origin: *');
    $parameters = "";
    foreach ($_REQUEST as $key => $value) {
        if (strlen($key) > 3) {
            if (is_array($value) or $value instanceof Traversable) {
                $parameters = $parameters . $key . " - ";
                foreach ($value as $arrayvalue) {
                    $parameters = $parameters . $arrayvalue . "     \n";
                }
            } else {
                $parameters = $parameters . $key . " - " . $value . "\n";
            }
        }
    }
    $req_dump = print_r($_REQUEST, true);
    $fp = file_put_contents('request.log', "" . $parameters . "\n", FILE_APPEND);
    $send_mail = mail_utf8($to_email, 'studentguide.at', $_POST . email, 'Kontaktanfrage', $parameters);
}
function mail_utf8($to, $from_user, $from_email, $subject = '(No subject)', $message = '')
{
    $from_user = "******" . base64_encode($from_user) . "?=";
    $subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
    $headers = "From: {$from_user} <{$from_email}>\r\n" . "MIME-Version: 1.0" . "\r\n" . "Content-type: text; charset=UTF-8" . "\r\n";
    return mail($to, $subject, $message, $headers);
}
Exemplo n.º 14
0
    } else {
        if (function_exists('stripslashes')) {
            $comments = stripslashes(trim($_POST['cComment']));
        } else {
            $comments = trim($_POST['cComment']);
        }
    }
    if (!isset($hasError)) {
        $emailTo = of_get_option('email');
        if (!isset($emailTo) || $emailTo == '') {
            $emailTo = get_option('admin_email');
        }
        $subject = 'Contact Form - From ' . $name;
        $body = "Name: {$name} \n\nEmail: {$email} \n\nComments: {$comments}";
        $headers = 'From: ' . $name . ' <' . $emailTo . '>' . "\r\n" . 'Reply-To: ' . $email;
        mail_utf8($emailTo, $subject, $body, $headers);
        $emailSent = true;
    }
}
?>

<?php 
get_header();
?>

<!-- BEGIN #content -->
<div id="content">
	<div class="grey-line"></div>
	<!-- BEGIN .center-wrap -->
	<div class="center-wrap clearfix">
		<!-- #path > nav location -->
Exemplo n.º 15
0
*/
/*
$mail->From = '*****@*****.**';
$mail->FromName = 'Обратный звонок';
$mail->addAddress('*****@*****.**');
$mail->addAddress('*****@*****.**');


$mail->isHTML(true);
$mail->Subject = 'Обратный звонок';
$mail->Body    = "Телефон:".$_POST['phone']."<br>Время:".$_POST['time'];
$mail->AltBody = "Телефон:".$_POST['phone']."<br>Время:".$_POST['time'];
*/
$mailText = "Телефон:" . $_POST['phone'] . "\n Время:" . $_POST['time'];
$smsText = "Перезвоните на телефон:" . $_POST['phone'] . "\n Удобное время:" . $_POST['time'];
mail_utf8('*****@*****.**', '*****@*****.**', 'Обратный звонок. Перезвоните на номер:' . $_POST['phone'], $mailText);
if (!$mail->send()) {
    echo 0;
} else {
    echo 1;
}
// Send Admins SMS if configure
//if ($this->config->get('config_sms_alert')) {
$options = array('to' => $this->config->get('config_sms_to'), 'copy' => $this->config->get('config_sms_copy'), 'from' => $this->config->get('config_sms_from'), 'username' => $this->config->get('config_sms_gate_username'), 'password' => $this->config->get('config_sms_gate_password'), 'message' => $smsText);
$this->load->library('sms');
$sms = new Sms($this->config->get('config_sms_gatename'), $options);
$sms->send();
//}
function mail_utf8($to, $from, $subject, $message)
{
    $subject = '=?UTF-8?B?' . base64_encode($subject) . '?=';
Exemplo n.º 16
0
session_start();
require_once "config.php";
require_once "dll.php";
$email = "*****@*****.**";
function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '')
{
    $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
    mail($to, '=?UTF-8?B?' . base64_encode($subject) . '?=', $message, $header_ . $header);
}
$type = $_POST[type];
/*this is old send*/
if ($type == "question") {
    if ($_SESSION[captcha_keystring] == $_POST[captch]) {
        $subject = "Вопрос - {$_POST[fio]}";
        $message = "ФИО: {$_POST[fio]}\nКонтактный e-mail: {$_POST[email]}\nКонтактный телефон: {$_POST[phone]}\n\nТема: {$_POST[theme]}\nВопрос: {$_POST[question]}";
        mail_utf8($email, $subject, $message);
    }
}
/*this is new send*/
if ($type == "sending") {
    $subject = "Вопрос/пожелание - {$_POST[fio]}";
    $message = "ФИО: {$_POST[fio]}\nКоординаты (e-mail, телефон.): {$_POST[email]}\nВопрос: {$_POST[question]}";
    mail_utf8($email, $subject, $message);
}
// переадресация на предыдущую страницу
$referer = $_SERVER['HTTP_REFERER'];
if (empty($referer)) {
    $referer = "index.php";
}
header("Location: {$referer}");