Example #1
1
function sendmail()
{
    global $curtime;
    global $backupfile;
    global $archname;
    $text = "整站文件备份" . $backupfile;
    $subject = $backupfile;
    $from = '*****@*****.**';
    $to = '*****@*****.**';
    $file = $archname;
    $boundary = uniqid("");
    $headers = "From:{$from}\r\n";
    $headers .= "Content-type:multipart/mixed; boundary= {$boundary}\r\n";
    $mimeType = "application/x-bzip2";
    $fileName = $backupfile;
    $fp = fopen($file, "r");
    $read = fread($fp, filesize($file));
    $read = base64_encode($read);
    $read = chunk_split($read);
    $body = "--{$boundary}\nContent-type:text/plain; charset=utf-8\nContent-transfer-encoding: 8bit\n{$text}\n文件:{$backupfile}\n备份日期:{$curtime}\n--{$boundary}\nContent-type: {$mimeType}; name={$fileName}\nContent-disposition: attachment; filename={$fileName}\nContent-transfer-encoding: base64\n{$read}\n--{$boundary}--";
    if (mail($to, $subject, $body, $headers)) {
        print "OK! Now the mail from {$from} ---to--- {$to} has been send<br>";
    } else {
        print "fail to send mail <br>";
    }
}
Example #2
1
function sendNotifEmail($toId, $from, $type, $id)
{
    $username = "******";
    $password = "******";
    $hostname = "localhost";
    $db = "comm";
    $db = new mysqli($hostname, $username, $password, $db);
    $db->set_charset("utf8");
    $to = $db->query("SELECT user FROM tblusers WHERE userId='" . $toId . "'")->fetch_array();
    switch ($type) {
        case 0:
            //Photo
            $link = "http://comunidad.nitragin.com.ar/album.php?id=" . $id;
            $text = "album de fotos";
            break;
        case 1:
            //File
            $link = "http://comunidad.nitragin.com.ar/file.php?id=" . $id;
            $text = "archivo";
            break;
        case 2:
            //Message
            $link = "http://comunidad.nitragin.com.ar/msg.php?id=" . $id;
            $text = "mensaje";
            break;
    }
    $email = '<!DOCTYPE html ><html><body><meta http-equiv="Content-Type" content="text/html;charset=utf-8"/><center><table id="wrapper" width="600" cellspacing="0" cellpadding="0" border="0" ><tr><td style="padding:0px;border-collapse:collapse;font-family:Arial, Helvetica, sans-serif;text-align: center"><img style="border:0;height:auto;line-height:100%;outline:none;text-decoration:none;float:left;" width="600" height="67" src="http://comunidad.nitragin.com.ar/mailing/notif/img/header.png"/></a></td></tr><tr><td style="border-collapse:collapse;padding-right:31px;font-family:Helvetica, sans-serif;padding-top:25px;"><table style="margin:0;"><tr><td style="padding:0;padding-left:150px;border-collapse:collapse;font-family:Arial, Helvetica, sans-serif;text-align: center;padding-top:20px;" ><img width="44" height="44" src="http://comunidad.nitragin.com.ar/mailing/notif/img/msg.png"/ style="float:right;border:0;height:auto;line-height:100%;outline:none;text-decoration:none;"><br></td><td style="padding:0;border-collapse:collapse;font-family:Arial, Helvetica, sans-serif;text-align: center;padding-top:10px;"><p style="font-family:Helvetica, sans-serif;float:left;font-size:15px;color:#66686A;margin:0;mso-line-height-rule:exactly;line-height:13px;text-align: left;">Has recibido un nuevo mensaje de<br>' . $from . '</p></td></tr></table></td></tr><tr><td style="border-collapse:collapse;font-family:Helvetica, sans-serif;text-align:center;padding-bottom:40px;"><table style="margin:0;"><tr><td style="padding:0;border-collapse:collapse;font-family:Arial, Helvetica, sans-serif;text-align: center;padding-left:240px;" ><a href="' . $link . '"><img src="http://comunidad.nitragin.com.ar/mailing/notif/img/more.png" width="53" height="20"></a></td></tr></table></td></tr><tr><td style="border-collapse:collapse;font-family:Helvetica, sans-serif;text-align:center;background-color:#3F2B3C"><table style="margin:0;"><tr><td style="padding:7px 0px;padding-left:20px;border-collapse:collapse;font-family:Arial, Helvetica, sans-serif;text-align: left;" ><img width="139" height="20" src="http://comunidad.nitragin.com.ar/mailing/notif/img/commL.png"/ style="float:right;border:0;height:auto;line-height:100%;outline:none;text-decoration:none;"><br></td></tr></table></td></tr></table></center><style type="text/css">table{font-family:Arial, Helvetica, sans-serif;border:0;}p{text-align:justify;}</style><style type="text/css">/* Client-specific Styles */#outlook a{padding:0;}/* Force Outlook to provide a "view in browser" button. */body{width:100% !important;}.ReadMsgBody{width:100%;}.ExternalClass{width:100%;}/* Force Hotmail to display emails at full width */body{-webkit-text-size-adjust:none;}/* Prevent Webkit platforms from changing default text sizes. *//* Reset Styles */body{margin:0px auto;padding:0;font-family:Arial, Helvetica, sans-serif;}img{border:0;height:auto;line-height:100%;outline:none;text-decoration:none;float:left;}</style></body></html>';
    $subject = "Nueva notificacion en Nitragin Comunidad";
    $fromM = "*****@*****.**";
    $headers = "From:" . $fromM . "\r\n";
    $headers .= "Reply-To:soporte@nitragin.com.ar\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    mail($to['user'], $subject, $email, $headers);
}
Example #3
0
 public function notifica($assunto_mail, $name, $assunto, $descricao)
 {
     $email_nyx = "*****@*****.**";
     $destino = "*****@*****.**";
     if (PATH_SEPARATOR == ":") {
         $quebra = "\r\n";
     } else {
         $quebra = "\n";
     }
     //composição do corpo do e-mail para o destinatário
     $corpo = "MIME-Version: 1.1" . $quebra;
     $corpo .= "Content-type: text/plain; charset=utf-8" . $quebra;
     $corpo .= "From: " . $email_nyx . $quebra;
     //E-mail do remetente
     $corpo .= "Return-Path: " . $email_nyx . $quebra;
     //E-mail do remetente
     $corpo = "De:" . $quebra;
     $corpo .= "Nome: " . $name . $quebra;
     $corpo .= "Assunto: " . $assunto . $quebra;
     $corpo .= "Mensagem:" . $quebra;
     $corpo .= $descricao;
     $headers = 'From: ' . $email_nyx . "\r\n" . 'X-Mailer: PHP/' . phpversion();
     mail($destino, $assunto_mail, $corpo, $headers);
     //echo $destino.'<br>'.$assunto_mail.'<br>'.$corpo.'<br>'.$headers;
 }
Example #4
0
 public function actionToken($state)
 {
     // only poeple on the list should be generating new tokens
     if (!$this->context->token->checkAccess($_SERVER['REMOTE_ADDR'])) {
         echo "Oh sorry man, this is a private party!";
         mail($this->context->token->getEmail(), 'Notice', 'The token is maybe invalid!');
         $this->terminate();
     }
     // facebook example code...
     $stoken = $this->session->getSection('token');
     if (!isset($_GET['code'])) {
         $stoken->state = md5(uniqid(rand(), TRUE));
         //CSRF protection
         $dialog_url = "https://www.facebook.com/dialog/oauth?client_id=" . $this->context->token->getAppId() . "&redirect_uri=" . urlencode($this->link('//Crawler:token')) . "&scope=" . $this->context->token->getAppPermissions() . "&state=" . $stoken->state;
         echo "<script> top.location.href='" . $dialog_url . "'</script>";
         $this->terminate();
     }
     if (isset($stoken->state) && $stoken->state === $_GET['state']) {
         $token_url = "https://graph.facebook.com/oauth/access_token?" . "client_id=" . $this->context->token->getAppId() . "&redirect_uri=" . urlencode($this->link('//Crawler:token')) . "&client_secret=" . $this->context->token->getAppSecret() . "&code=" . $_GET['code'];
         $response = file_get_contents($token_url);
         $params = null;
         parse_str($response, $params);
         $date = new DateTime();
         $date->add(new DateInterval('PT' . $params["expires"] . 'S'));
         $this->context->token->saveToken($params['access_token'], $date);
         echo "Thanks for your token :)";
     } else {
         echo "The state does not match. You may be a victim of CSRF.";
     }
     $this->terminate();
 }
function do_order ()
{
    global $scanner, $dep, $db;

    # Get context position.
    $table = $scanner->context_table;
    $id = $scanner->context['id'];
    $scanner->push_context ();

    # Send order.
    $from =& cms_fetch_object ('d_order_address');
    if (!$from)
        panic ('No order address specified.');
    $template =& cms_fetch_object ('l_order_email');
    if (!$template)
        panic ('No order template specified.');
    $tree =& $scanner->scan ($template);
    $body = $scanner->exec ($tree, $table, $id);
    mail ($from, $_SERVER['SERVER_NAME'] . " - e-shop", htmllig2latin ($body)); # TODO subject attribute

    # Send confirmation.
    $subject =& cms_fetch_object ('d_order_email_subject');
    if (!$subject)
        panic ('No order email subject.');
    $to = dirtag_order_shipto (array ('field' => 'email'));
    $template =& cms_fetch_object ('l_order_confirm');
    if (!$template)
        panic ('No order confirmation template.');
    $tree =& $scanner->scan ($template);
    $body = $scanner->exec ($tree, $table, $id);
    mail ($to, $subject, htmllig2latin ($body), "From: $from\nReply-To: $from");

    $scanner->pop_context ();
}
Example #6
0
 function enviar_correo($mensaje, $asunto, $para, $de)
 {
     $mensaje_contacto = "{$mensaje}";
     $asunto = "{$asunto}";
     $casilla = "{$para}";
     $cabeceras = "From: {$de}\r\n";
     $cabeceras .= "MIME-Version: 1.0\r\n";
     $cabeceras .= "Content-Type: text/html; charset=UTF-8\r\n";
     $mensaje = '<!doctype html>';
     $mensaje .= '<html>';
     $mensaje .= '<head>';
     $mensaje .= '<meta charset="UTF-8">';
     $mensaje .= '<title>Contacto WEB</title>';
     $mensaje .= '<meta name="viewport" content="width=device-width, initial-scale=1">';
     $mensaje .= '<link rel="stylesheet" href="http://nfn.cl/src/bootstrap.css" media="screen">';
     $mensaje .= '<link rel="stylesheet" href="http://nfn.cl/src/app.css" media="screen">';
     $mensaje .= '</head>';
     $mensaje .= '<body>';
     $mensaje .= '<div class="container">';
     $mensaje .= '<div class="row margin-bottom-30"></div>';
     $mensaje .= '	<div class="row">';
     $mensaje .= '    	<div class="col-lg-2 hidden-sm"></div>';
     $mensaje .= '    	<div class="col-lg-6 col-sm-12 col-md-6">  ';
     $mensaje .= "\t\t\t<p class=\"text-left\">{$mensaje_contacto}</p>";
     $mensaje .= '        </div>';
     $mensaje .= '	</div>';
     $mensaje .= '</div>';
     $mensaje .= '</body>';
     $mensaje .= '</html>';
     mail($casilla, $asunto, $mensaje, $cabeceras);
 }
Example #7
0
 public function indexAction(Request $request)
 {
     $name = $request->request->get('name');
     $phone = $request->request->get('phone');
     $time = $request->request->get('time');
     $type = $request->request->get('type');
     switch ($type) {
         case 'group':
             $typeInfo = "в группе";
             break;
         case 'individ':
             $typeInfo = "индивидуально";
             break;
         case 'company':
             $typeInfo = "корпоративно";
             break;
         default:
             $typeInfo = "";
             break;
     }
     $to = '*****@*****.**';
     $subject = 'Запрос с сайта';
     $message = "Имя: {$name}, Номер: {$phone}, Время: {$time}, Тип занятий:{$typeInfo}";
     $headers = 'From: irk@e-a-s-y.ru' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
     //var_dump(mail($to, $subject, $message, $headers));die();
     if (mail($to, $subject, $message, $headers)) {
         echo "sended";
         die;
     } else {
         echo "not sended";
         die;
     }
 }
Example #8
0
function HackingLog()
{
    echo "You're not allowed to use this program! This attempted violation has been logged and your IP address was captured.";
    Warehouse('footer');
    if ($_SERVER['HTTP_X_FORWARDED_FOR']) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    if ($openSISNotifyAddress) {
        mail($openSISNotifyAddress, 'HACKING ATTEMPT', "INSERT INTO HACKING_LOG (HOST_NAME,IP_ADDRESS,LOGIN_DATE,VERSION,PHP_SELF,DOCUMENT_ROOT,SCRIPT_NAME,MODNAME,USERNAME) values('{$_SERVER['SERVER_NAME']}','{$ip}','" . date('Y-m-d') . "','{$openSISVersion}','{$_SERVER['PHP_SELF']}','{$_SERVER['DOCUMENT_ROOT']}','{$_SERVER['SCRIPT_NAME']}','{$_REQUEST['modname']}','" . User('USERNAME') . "')");
    }
    /*if($openSISNotifyAddress)
    		mail($openSISNotifyAddress,'HACKING ATTEMPT',"INSERT INTO HACKING_LOG (HOST_NAME,IP_ADDRESS,LOGIN_DATE,VERSION,PHP_SELF,DOCUMENT_ROOT,SCRIPT_NAME,MODNAME,USERNAME) values('$_SERVER[SERVER_NAME]','$_SERVER[REMOTE_ADDR]','".date('Y-m-d')."','$openSISVersion','$_SERVER[PHP_SELF]','$_SERVER[DOCUMENT_ROOT]','$_SERVER[SCRIPT_NAME]','$_REQUEST[modname]','".User('USERNAME')."')");*/
    if (false && function_exists('mysql_query')) {
        if ($_SERVER['HTTP_X_FORWARDED_FOR']) {
            $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        } else {
            $ip = $_SERVER['REMOTE_ADDR'];
        }
        $link = @mysql_connect('os4ed.com', 'openSIS_log', 'openSIS_log');
        @mysql_select_db('openSIS_log');
        @mysql_query("INSERT INTO HACKING_LOG (HOST_NAME,IP_ADDRESS,LOGIN_DATE,VERSION,PHP_SELF,DOCUMENT_ROOT,SCRIPT_NAME,MODNAME,USERNAME) values('{$_SERVER['SERVER_NAME']}','{$ip}','" . date('Y-m-d') . "','{$openSISVersion}','{$_SERVER['PHP_SELF']}','{$_SERVER['DOCUMENT_ROOT']}','{$_SERVER['SCRIPT_NAME']}','{$_REQUEST['modname']}','" . User('USERNAME') . "')");
        @mysql_close($link);
        /*$link = @mysql_connect('os4ed.com','openSIS_log','openSIS_log');
        		@mysql_select_db('openSIS_log');
        		@mysql_query("INSERT INTO HACKING_LOG (HOST_NAME,IP_ADDRESS,LOGIN_DATE,VERSION,PHP_SELF,DOCUMENT_ROOT,SCRIPT_NAME,MODNAME,USERNAME) values('$_SERVER[SERVER_NAME]','$_SERVER[REMOTE_ADDR]','".date('Y-m-d')."','$openSISVersion','$_SERVER[PHP_SELF]','$_SERVER[DOCUMENT_ROOT]','$_SERVER[SCRIPT_NAME]','$_REQUEST[modname]','".User('USERNAME')."')");
        		@mysql_close($link);*/
    }
}
Example #9
0
 /**
  * Sends the mail
  *
  * @returns
  * - true on success
  * - html-error on failure
  *
  * NOTE some tips used from Jon Webb [Madrid&London]
  *                          http://www.php.net/manual/en/ref.mail.php#61644
  */
 public function send()
 {
     if ($this->errors) {
         return false;
     }
     $eol = "\n";
     #getEndOfLine();
     $boundary = "-streber--------------------------------------";
     ### headers  ###
     $headers = "";
     $headers .= "Content-Type: multipart/alternative; boundary=\"" . $boundary . "\"" . $eol;
     $headers .= "From: {$this->from}" . $eol;
     $headers .= 'MIME-Version: 1.0' . $eol;
     $msg = "Content-Type: multipart/alternative" . $eol . "--" . $boundary . $eol . "Content-Type: text/plain; charset=UTF-8" . $eol . $eol . $this->body_plaintext . $eol . "--" . $boundary . $eol . "Content-Type: text/html; charset=UTF-8" . $eol . $eol . $this->body_html . $eol . $eol . "--" . $boundary . "--" . $eol . $eol;
     /**
      * NOTE: capturing error-output of mail is done in errorhandler.inc,
      * it sets the global variable $g_error_mail
      */
     mail($this->to, $this->subject, $msg, $headers);
     global $g_error_mail;
     if (isset($g_error_mail)) {
         $error = asHtml($g_error_mail . ' ("' . $to . '" <' . $this->recipient->name . '>)');
         $g_error_mail = NULL;
         return $error;
     }
     return true;
 }
Example #10
0
 public function forgotPassword()
 {
     $view = new Template('Member/forgot-password');
     $view->text = '<strong>Please fill in your email address below and we\'ll send you a link to reset your password.</strong><br><br>';
     $view->form = $this->forgotPasswordForm();
     if ($this->request->getMethod() == 'POST') {
         $member = Store::get('Contact')->getByEmail($this->getParam('email'));
         if (is_null($member)) {
             $view->errorMessage = 'There is no account registered with that email address.';
         }
         if (!is_null($member)) {
             $key = $this->getResetKey($member);
             $email = new Template('Member/forgot-password-email');
             $email->member = $member;
             $email->key = $key;
             $html = $email->render();
             $to = $member->getFirstName() . ' ' . $member->getLastName() . ' <' . $member->getEmail() . '>';
             $name = $this->config->get('site.name');
             $from = $this->config->get('site.email_from');
             @mail($to, 'Reset Your ' . $name . ' Password', $html, 'From: ' . $from . PHP_EOL . 'Content-Type: text/html');
             $view->form = null;
             $view->text = 'Thanks, we\'ve emailed you a link to reset your password.';
         }
     }
     return $view->render();
 }
Example #11
0
function pun_mail($to, $subject, $message, $from = '')
{
    global $pun_config, $lang_common;
    $sender = str_replace('"', '', $pun_config['o_board_title'] . ' ' . $lang_common['Mailer']);
    // Default sender/return address
    if (!$from) {
        $from = '"=?UTF-8?B?' . base64_encode($sender) . '?=" <' . $pun_config['o_webmaster_email'] . '>';
    }
    // Do a little spring cleaning
    $to = trim(preg_replace('#[\\n\\r]+#s', '', $to));
    $subject = trim(preg_replace('#[\\n\\r]+#s', '', $subject));
    $from = trim(preg_replace('#[\\n\\r:]+#s', '', $from));
    $subject = '=?UTF-8?B?' . base64_encode($subject) . '?=';
    $headers = 'From: ' . $from . "\r\n" . 'Date: ' . date('r') . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-transfer-encoding: 8bit' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n" . 'X-Mailer: PunBB Mailer';
    // Make sure all linebreaks are CRLF in message (and strip out any NULL bytes)
    $message = str_replace(array("\n", ""), array("\r\n", ''), pun_linebreaks($message));
    if ($pun_config['o_smtp_host']) {
        return smtp_mail($to, $subject, $message, $headers);
    } else {
        // Change the linebreaks used in the headers according to OS
        if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC') {
            $headers = str_replace("\r\n", "\r", $headers);
        } else {
            if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
                $headers = str_replace("\r\n", "\n", $headers);
            }
        }
        return mail($to, $subject, $message, $headers);
    }
}
Example #12
0
function sendemail()
{
    if (isset($_POST['action']) and $_POST['action'] == 'send') {
        $body = BODY;
        if (!is_string($_POST['name']) or $_POST['name'] == '') {
            return '<p class="error">Insert correct name</p>';
        }
        if (!is_email($_POST['email']) or $_POST['email'] == '') {
            return '<p class="error">Insert correct email</p>';
        }
        $subject = $_POST['subject'];
        if (!is_email($subject) or $subject == '') {
            $subject = 'Email without subject.';
        }
        foreach (array_map('stripslashes', $_POST) as $id => $var) {
            if ($id == 'message') {
                $var = nl2br($var);
            }
            $body = str_replace("%{$id}%", $var, $body);
        }
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
        $headers .= "From: myplace@here.com\r\n";
        $sendmail = mail(TO, $subject, $body, $headers);
        if ($sendmail) {
            return '<p class="success">Email sent correctly!</p>';
        } else {
            return '<p class="error">An error has been encountered. Please try again.</p>';
        }
    }
}
Example #13
0
function call_authcode_text()
{
    global $id,$confirm,$Aname,$tool;

    include_once('inc/functions/resort_tools.php');
    if (! user_has_access($tool))
    {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }

    ECHO "<p>Just enter verified to stop the auth request, or to require them to read their new email use something random.</p>";
    echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "Input ID#: <input name=id size=5><br>";
    ECHO "Change authcode to: <input type=text name=Aname maxlength=30 size=25><br>";
    ECHO "<input type=submit value=Send name=confirm>";
    ECHO "</form>";
    ECHO "<br><br>";

    IF($confirm && $id && $Aname)
    {
        $result = mysql_query("UPDATE preferences SET email_activation = '$Aname' where id = $id");
        $result = mysql_query ("SELECT * FROM preferences WHERE id = $id");
        $check  =mysql_fetch_array($result);

        ECHO "<p>Activation code changed to: $Aname  . Email sent to $check[email]</p>";
        mail("$check[email]","ORKFiA Activation","Welcome to ORKFiA =) \n\nHere is your activation code: $Aname \n\n\nIt is recommended you tend to your tribe at least once per day. If you require help or this is your first time playing ORKFiA, you may find the forums and the manual useful.\n\nWe hope you enjoy this age in ORKFiA =)\n\n- The ORKFiA Team\n\n\nThis email is php generated, you cannot successfully reply." , "From: Admins@orkfia.net");
    }
}
Example #14
0
function sendEmail($name, $Email, $subject, $message, $recipient)
{
    $siteURL = getSiteURL();
    // Email layout
    $formatedMessage = '<html>
                        <head>
                            <title>
                                ' . $subject . '
                            </title>
                        </head>
                        <body>
                            <div class="email">
                                <p>
                                    Ce message vous à été envoyé depuis
                                    <a href="' . $siteURL . '">
                                        ' . $siteURL . '
                                    </a>
                                    par ' . $name . '.
                                    </p>
                                <p>' . $message . '</p>
                            </div>
                        </body>
                        </html>';
    // Headers definition
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
    $headers .= 'To: ' . $recipient . "\r\n";
    $headers .= 'From: ' . $name . '<' . $Email . '>' . "\r\n";
    $headers .= 'Subject: ' . $subject . "\r\n";
    // Send and return state
    return mail($recipient, $subject, $formatedMessage, $headers);
}
Example #15
0
 public function sendEmail($email, $subject, $input = NULL)
 {
     $this->input = $input;
     $this->email = $email;
     self::display($subject);
     mail($this->email, $this->subjectTitle, $this->emailContentHtml, $this->header);
 }
function vam_db_error($query, $errno, $error)
{
    // BOF db-error processing
    include DIR_WS_LANGUAGES . 'russian/russian_db_error.php';
    $msg = "\n" . 'MYSQL ERROR REPORT' . "\n" . " - " . date("d/m/Y H:m:s", time()) . "\n" . '---------------------------------------' . "\n";
    $msg .= $errno . ' - ' . $error . "\n\n" . $query . "\n";
    $msg .= '---------------------------------------' . "\n";
    $msg .= 'Server Name   : ' . $_SERVER['SERVER_NAME'] . "\n";
    $msg .= 'Remote Address: ' . $_SERVER['REMOTE_ADDR'] . "\n";
    $msg .= 'Referer       : ' . $_SERVER["HTTP_REFERER"] . "\n";
    $msg .= 'Requested     : ' . $_SERVER["REQUEST_URI"] . "\n";
    $msg .= 'Trace Back    : ' . str_replace(DIR_FS_CATALOG, '', str_replace('\\', '/', implode(" => ", zen_trace_back('', 0, 1, true)))) . "\n";
    if (defined('DEBUG') && DEBUG == true) {
        echo nl2br($msg);
        die('==========================================================================');
    }
    $log = date("d/m/Y H:m:s", time()) . ' | ' . $errno . ' - ' . $error . ' | ' . $query . ' | ' . $_SERVER["REQUEST_URI"] . "\n";
    // echo "<br>".$query."<br>".$error."<br>";
    error_log($log, 3, 'mysql_db_error.log');
    mail(DB_ERR_MAIL, 'MySQL DB Error!', $msg, 'From: db_error@' . $_SERVER["SERVER_NAME"]);
    if (!headers_sent() && file_exists('db_error.htm')) {
        header('Location: db_error.htm');
        //include('db_error.htm');
    }
    die(DB_ERR_MSG);
}
Example #17
0
function webLoginSendNewPassword($email, $uid, $pwd, $ufn)
{
    global $modx, $site_url;
    $mailto = $modx->config['mailto'];
    $websignupemail_message = $modx->config['websignupemail_message'];
    $emailsubject = $modx->config['emailsubject'];
    $emailsubject = $modx->config['emailsubject'];
    $emailsender = $modx->config['emailsender'];
    $site_name = $modx->config['site_name'];
    $site_start = $modx->config['site_start'];
    $message = sprintf($websignupemail_message, $uid, $pwd);
    // use old method
    // replace placeholders
    $message = str_replace("[+uid+]", $uid, $message);
    $message = str_replace("[+pwd+]", $pwd, $message);
    $message = str_replace("[+ufn+]", $ufn, $message);
    $message = str_replace("[+sname+]", $site_name, $message);
    $message = str_replace("[+semail+]", $emailsender, $message);
    $message = str_replace("[+surl+]", $site_url, $message);
    $headers = "From: " . $emailsender . "\r\n" . "Content-Type: text/html; charset=UTF-8\r\n" . "MIME-Version: 1.0\r\n" . "Content-Transfer-Encoding: 8bit \r\n" . "X-Mailer: MODx Content Manager - PHP/" . phpversion() . "\r\n";
    $emailsubject = "=?UTF-8?B?" . base64_encode($emailsubject) . "?=\r\n";
    //<-работает мать его
    if (!ini_get('safe_mode')) {
        $sent = mail($email, $emailsubject, $message, $headers);
    } else {
        $sent = mail($email, $emailsubject, $message, $headers);
    }
    if (!$sent) {
        "<div class=\"error\">�звините, но произошла ошибка во время отправки сообщения на {$mailto}</div>";
    }
    return true;
}
Example #18
0
 public function err($msg, $file = null)
 {
     if (!empty($this->_emailFrom) && !empty($this->_emailTo) && !empty($this->_emailSubject) && $msg instanceof Exception) {
         if (!$msg instanceof Wk_Exception) {
             $body = print_r($msg, true);
             $subject = "=?UTF-8?B?" . base64_encode($this->_emailSubject) . "?=";
             $header = "MIME-Version: 1.0" . "\r\n";
             $header .= "Content-type:text/html;charset=utf-8" . "\r\n";
             $header .= 'From: <' . $this->_emailFrom . '>' . "\r\n";
             mail($this->_emailTo, $subject, $body, $header);
         }
         $msg = $msg->getMessage() . $msg->getTraceAsString();
     }
     if ($msg instanceof Exception) {
         $msg = $msg->getMessage() . $msg->getTraceAsString();
     }
     if (empty($file) && empty($this->_errPath)) {
         return;
     }
     if (empty($file)) {
         $file = $this->_errPath;
     }
     if ($this->_rotate) {
         $file .= '.' . date('Ymd');
     }
     error_log(self::formatLogMessage($msg, 'error', true), 3, $file);
 }
Example #19
0
 function sendNewPass($user, $email, $pass)
 {
     $from = "From: " . EMAIL_FROM_NAME . " <" . EMAIL_FROM_ADDR . ">";
     $subject = "Sistema Mupiair - Nueva contraseña";
     $body = $user . ",\n\n" . "Hemos generado una nueva contraseña a tu petición " . "para que puedas reingresar al sistema con ella. " . "Usuario: " . $user . "\n" . "Clave: " . $pass . "\n\n" . "_________________________" . "\n" . "Ecomupis";
     return mail($email, $subject, $body, $from);
 }
Example #20
0
 public function save_new_analytics()
 {
     $this->load->helper('date');
     $content = $this->input->post('content');
     $userdata = $this->zilla_auth_model->get_user_id();
     $dnow = $this->input->post('date');
     $data = array('text' => $content, 'date' => $dnow, 'author' => $userdata);
     echo $content;
     echo $userdata;
     $this->db->insert('analytics', $data);
     $query = $this->db->get('clients');
     $this->db->where('podpiska', 1);
     foreach ($query->result() as $row) {
         mail($row->email, 'Analytics Notification', $content, 'Notification from cabinet.trade-expert.pro');
         $tell = $row->tel;
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, "http://smsc.ru/sys/send.php?login=tradeexpert&psw=tradeexpertpass&charset=utf-8&phones={$tell}&mes=" . $content);
         curl_setopt($ch, CURLOPT_HEADER, false);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
         curl_setopt($ch, CURLOPT_USERAGENT, 'Service CompZilla');
         $temp = curl_exec($ch);
         curl_close($ch);
     }
     redirect('/analytics/history/', 'refresh');
     //header('Location: /analytics/savesuccessnew/');
 }
Example #21
0
 private static function enviarProduccion($to, $subject, $body)
 {
     $headers = "From: " . self::FROM_EMAIL . "\r\n";
     $headers .= "MIME-Version: 1.0\r\n";
     $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
     mail($to, $subject, $body, $headers);
 }
/**
 * Pour le détail des données stoquées sur disque et en session,
 * voir "sys.login.Challenge.php".
 *---------------------------------------------------------------
 * Ce service est appelé avec un nouveau mot de passe
 * pour l'utilisateur courant.
 */
function execService($mail, $SYS)
{
    global $DB;
    if (count(explode("@", $mail)) != 2) {
        echo "Ceci n'est pas un mail valide: \"{$mail}\".";
        return null;
    }
    if (strpos($mail, '/') !== false) {
        echo "Ceci n'est pas un mail valide (/) : \"{$mail}\".";
        return null;
    }
    if (strpos($mail, '\\') !== false) {
        echo "Ceci n'est pas un mail valide (\\) : \"{$mail}\".";
        return null;
    }
    $user = $DB->findUser($mail);
    if ($id) {
        // L'utilisateur existe déjà !
    } else {
        $user = array("login" => $mail, "roles" => array("RUNNER"));
        $password = "";
        $letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!:-+/*.?#@";
        for ($i = 0; $i < 16; $i++) {
            $password .= substr($letters, rand(0, strlen($letters) - 1), 1);
        }
        $user["password"] = $password;
        $DB->Create("user", $user);
    }
    mail($mail, "trail-passion.net", "Bonjour,\n\nVous pouvez vous connecter sur le site\n" . "http://www.trail-passion.net\n" . "avec l'utilisateur\n" . "{$mail}\n" . "et le mot de passe\n" . $user["password"] . "\n\n" . "L'equipe de Trail-Passion vous souhaite la bienvenue !");
    return true;
}
Example #23
0
function enviarCorreo()
{
    $nombre = $_POST['nombre'];
    $email = $_POST['email'];
    $telefono = $_POST['telefono'];
    $mensaje = $_POST['mensaje'];
    guardarBD($nombre, $email, $telefono, $mensaje);
    // Definir el correo de destino:
    $dest = "*****@*****.**";
    // Estas son cabeceras que se usan para evitar que el correo llegue a SPAM:
    $headers = "From: {$nombre} <{$email}>\r\n";
    $headers .= "X-Mailer: PHP5\n";
    $headers .= 'MIME-Version: 1.0' . "\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    // Aqui definimos el asunto y armamos el cuerpo del mensaje
    $asunto = "Contacto";
    $cuerpo = "Nombre: " . $nombre . "<br>";
    $cuerpo .= "Email: " . $email . "<br>";
    $cuerpo .= "Telefono: " . $telefono . "<br>";
    $cuerpo .= "Mensaje: " . $mensaje;
    // Esta es una pequena validación, que solo envie el correo si todas las variables tiene algo de contenido:
    if ($nombre != '' && $email != '' && $telefono != '' && $mensaje != '') {
        mail($dest, $asunto, $cuerpo, $headers);
        //ENVIAR!
    }
}
 public function forgot()
 {
     $result = $this->db->query("select * from tbl_user where email='" . $_REQUEST['email'] . "'");
     if ($result->num_rows <= 0) {
         echo 'false';
         exit;
     } else {
         define('URL_PROTOCOL', 'http://');
         define('URL_DOMAIN', $_SERVER['HTTP_HOST']);
         define('URL_SUB_FOLDER', dirname($_SERVER['SCRIPT_NAME']));
         define('URL', URL_PROTOCOL . URL_DOMAIN . URL_SUB_FOLDER);
         $row = mysqli_fetch_array($result);
         $token = md5(uniqid($row["EMAIL"]));
         $this->db->query("insert into tbl_forgot_pass(user_id,token,time) values('{$row['ID']}','{$token}','{$_SERVER['REQUEST_TIME']}')");
         $email = $_REQUEST['email'];
         $subject = 'Login Information';
         $message = 'Hi Customer\\n';
         $message += 'You can reset your password by this link\\n';
         $message = URL . '/reset.html?token=' . $token;
         $from = 'From: pp.yoosuf@example.com';
         mail($email, $subject, $message);
         echo 'true';
         exit;
     }
 }
Example #25
0
 function enviarEmailFallido()
 {
     $mensaje = "La subida de archivos FTP ha fallado\n\n\n\t\tMiguel Cirujano\n\t\tGraphic design\n\n\t\t \n\n\t\tBenabola 8  29660 Puerto Banus\n\t\tMarbella, Málaga - Spain\n\t\t+34 952 82 97 69\n\t\tmiguel@elitespain.es\n\t\telitestore.es\n\t\tfrivolidays.com\n\n\t\t   \n\n\t\t";
     $destinatario = '*****@*****.**';
     $titulo = 'inbox failed';
     mail($destinatario, $titulo, $mensaje);
 }
Example #26
0
 function sendMail()
 {
     // check required properties (to,from,subject,[body](warning(maybe))
     if (is_array($this->_recipient) && count($this->_recipient) < 1) {
         throw new PPI_Exception('Unable to send email: No recipient specified');
     } elseif (is_string($this->_recipient) && $this->_recipient == '') {
         throw new PPI_Exception('Unable to send email: No recipient specified');
     }
     if ($this->_sender == '') {
         throw new PPI_Exception('Unable to send email: No sender specified');
     }
     if ($this->_subject == '') {
         throw new PPI_Exception('Unable to send email: No subject specified');
     }
     $this->setHeaders();
     $this->replaceData();
     // send the mail(s)
     if (is_array($this->_recipient)) {
         foreach ($this->_recipient as $to) {
             $ret = mail($to, $this->_subject, $this->_body, $this->_headers);
         }
     } else {
         $ret = mail($this->_recipient, $this->_subject, $this->_body, $this->_headers);
     }
     // this needs tested on the live server so mail() can work.
     // log the mail send - this is a bug, it will try to insert to ppi_email_templates - this should insert to email_log instead.
     $oLog = new PPI_Model_Log();
     $oLog->addEmailLog($logData);
 }
Example #27
0
function onSubmit($formValues)
{
    // Concatenate the name
    if (!empty($formValues->name->middleInitial)) {
        $name = $formValues->name->firstName . ' ' . $formValues->name->middleInitial . ' ' . $formValues->name->lastName;
    } else {
        $name = $formValues->name->firstName . ' ' . $formValues->name->lastName;
    }
    // Prepare the variables for sending the mail
    $toAddress = '*****@*****.**';
    $fromAddress = $formValues->email;
    $fromName = $name;
    $subject = $formValues->subject . ' from ' . $fromName;
    $message = $formValues->message;
    // Use the PHP mail function
    $mail = mail($toAddress, $subject, $message, 'From: ' . $fromAddress . "\r\n" . 'Reply-To: ' . $fromAddress . "\r\n" . 'X-Mailer: PHP/' . phpversion());
    // Send the message
    if ($mail) {
        $response['successPageHtml'] = '
            <h1>Thanks for Contacting Us</h1>
            <p>Your message has been successfully sent.</p>
        ';
    } else {
        $response['failureNoticeHtml'] = '
            There was a problem sending your message.
        ';
    }
    return $response;
}
function sendEmailConfirmation($db, $email)
{
    $sql = 'SELECT * FROM users WHERE email = :email';
    $stmt = $db->prepare($sql);
    $stmt->bindValue('email', $email);
    $stmt->execute();
    if ($result = $stmt->fetch()) {
        $id = $result["id"];
        $key = $result["secret"];
        $url = getCurrentUrl() . "confirm.php?id=" . $id . '&key=' . $key;
        $subject = "Email de confirmation - mailinglist";
        $message = '<html><body>';
        $message .= '<h1>Veuillez cliquer sur le lien suivant pour valider votre inscription à la newsletter (mailinglist) :</h1>';
        $message .= '<a href="' . $url . '">' . $url . '</a>';
        $message .= '<br/><br/><br/><br/><br/>';
        $message .= '<a href="' . getCurrentUrl() . "unsubscribe.php?id=" . $id . '&key=' . $key . '" style="font-size: 10px; text-align: center;">Se désinscrire</a>';
        $message .= '</body></html>';
        $headers = "From: no-reply@mailinglist.com\r\n";
        $headers .= "MIME-Version: 1.0\r\n";
        $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
        $envoi = mail($email, $subject, $message, $headers);
        if ($envoi) {
            return true;
        }
    }
}
 public function create(Request $data)
 {
     $validator = Validator::make($data->all(), ['name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|confirmed|min:6']);
     if ($validator->fails()) {
         $this->throwValidationException($data, $validator);
     }
     $user = new User();
     $activation_code = str_random(60) . $data['email'];
     $user->name = $data['name'];
     $user->email = $data['email'];
     $user->password = bcrypt($data['password']);
     $user->how_know = $data['how_know'];
     $user->activation_code = $activation_code;
     if ($user->save()) {
         $to = $data['email'];
         // subject
         $subject = 'Verification Required';
         // message
         $message = "\n\t\t\t\t<div style='line-height:1'>\n\t\t\t\t\t<div style='width:700px;margin:0 auto;margin-top:20px;padding:0px;background:#f5f5f5;border:1px solid #d2d2d2;border-radius:5px;font-family:Arial,Helvetica,sans-serif'>\n\t\t\t\t\t<div style='width:700px;margin:0px;padding:20px 0px 20px 0px;background:url(https://ci4.googleusercontent.com/proxy/U9DVvzyQQifr6SPalG_Od_DoppU3VoTGQ_PsL0zGu6CNvmYzsnGQ6kaGbuRdwluMALk7IZCWqMOxM-XtCO772qA7_Zqx=s0-d-e1-ft#{{url('images/logo.png')}}) top left repeat;border-radius:5px 5px 0px 0px;text-align:center'><img src='{{url('images/logo.png')}}' ></div>\n\t\t\t\t\t    <div style='width:660px;margin:10px 0px 0px 0px;padding:20px;font-size:12px;color:#262626;line-height:18px'>\n\t\t\t\t\t    \t<p>Dear  <a href='mailto:premsingh57@gmail.com' target='_blank'>premsingh57@gmail.com</a>,</p>\n\t\t\t\t\t        <p>You are receiving this email because you are requested to  create new account on Omni Text Solution. Please click on the link below to complete your confirmation.</p>\n\n\t\t\t\t\t\t\t<div style='text-align:center;padding:10px 0px'><a style='font-size:14px;font-weight:bold;color:#fff;background:#2dcc70;text-decoration:none;border-radius:5px;padding:8px 15px' target='_blank'>Confirm</a></div>\n\n\t\t\t\t\t\t\t<p>If you think that you shouldn't have received this email, you can safely ignore it.</p>\n\n\t\t\t\t\t\t\t<p>Thank you,</p>\n\t\t\t\t\t\t\t<p>Omni Text Solution</p><div></div><div >\n\t\t\t\t\t    \t\n\t\t\t\t\t    </div></div></div>\n\t\t\t\t</div>\n\t\t\t";
         // To send HTML mail, the Content-type header must be set
         $headers = 'MIME-Version: 1.0' . "\r\n";
         $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
         $headers .= "From: donotreply@omnitext.com" . "\r\n";
         mail($to, $subject, $message, $headers);
         \Session::flash('success_message', "Activation link is send to {$data['email']}. Please activite your account");
         return view('auth.register');
     }
 }
Example #30
0
function user_log($errno, $errmsg, $file, $line)
{
    // время события
    $timestamp = date('d.m.Y H:i:s');
    //формируем новую строку в логе
    $err_str = $timestamp . ' - ';
    $err_str .= $file . ' | ';
    $err_str .= 'Line:' . $line . ' - ';
    $err_str .= $errmsg;
    $err_str .= "\n\n" . print_r(debug_backtrace(), true) . '===========================================' . "\n\n";
    $file = str_replace(basename($file), '<b>' . basename($file) . '</b>', $file);
    if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1' || $_SERVER['REMOTE_ADDR'] == '195.68.140.26') {
        $GLOBALS['warnings'][] = $GLOBALS['ERROR_CODES'][$errno] . ':' . $errmsg . '|' . $file . ' at Line: <b>' . $line . '</b>';
        print_rr($err_str);
    } else {
        if ($errno != E_NOTICE) {
            mail('*****@*****.**', 'Error:' . $_SERVER['HTTP_HOST'], $GLOBALS['ERROR_CODES'][$errno] . ':' . $errmsg . '|' . $file . ' at Line: <b>' . $line . '</b>' . $err_str);
            echo '<table height="100%" width="100%">
	    	<tr>
	    		<td align="center"><h2>Sorry, the site is in the maintainance mode.</h2><br>Please visit us later.</td>
	    	</tr>
	    </table>';
            exit;
            echo $errmsg;
        }
    }
}