function sendAct($user) { if ($user == 'rocky') { $email = "*****@*****.**"; } else { if ($user == 'admin') { $email = '*****@*****.**'; } else { $email = '*****@*****.**'; } } $str = random_string(8); smtpmailer($email, GUSER, 'RIMS System protection', "User " . $user . " is disabled", "You need to activate your account using the following code: [ " . $str . " ]"); return $str; }
function tempPassword($conn, $email, &$errorMsg) { $errorMsg = ""; try { //Generate a RANDOM MD5 Hash for a password $randomPassword = md5(uniqid(rand())); //Take the first 8 digits and use them as the temp password $newPassword = substr($randomPassword, 0, 8); //retrieve User info from DB $bd = $conn->prepare("CALL sp_getUserIdFromCredentials(?,?)"); $bd->execute(array($this->username, $this->password)); if ($db->rowCount() > 0) { $bd->bindColumn(1, $userID); $bd->fetch(PDO::FETCH_BOUND); //insert new password into DB $bd = $conn->prepare("CALL insertTempPassword(?,?)"); $db->execute(array($email, $newPassword)); //get return message if ($db->rowCount() > 0) { $bd->bindColumn(1, $statusMsg); $bd->fetch(PDO::FETCH_BOUND); $errorMsg .= $statusMsg; } $success = true; } else { $errorMsg .= "Invalid username or password."; } if ($success == true) { define('GUSER', '*****@*****.**'); // GMail username define('GPWD', '0xC0ff33'); // GMail password //Email password $subject = "New Password"; $message = "Your temporary password for SOUSMS is as follows:\n ---------------------------- \n Password: {$newPassword}\n ---------------------------- \n Please change this password when you login"; if (!smtpmailer($email, GUSER, "SOU SMS", $subject, $message)) { $errorMsg = "Sending Email Failed, Please Contact Site Admin! (soustockmarketsimulation@gmail.com)"; die($errorMsg); } else { $errorMsg = 'New Password Sent!'; } } } catch (PDOException $e) { $errorMsg .= "Error: " . $e->getMessage(); } return $success; }
function send_verification_mail($email, $hash) { $to = $email; // Send email to our user $subject = 'Signup | Verification'; // Give the email a subject $message = ' Thanks for signing up! Your account has been created, Please click this link to activate your account and set your password: http://localhost/news_app/users/verify?email=' . $email . '&hash=' . $hash . ' '; // Our message above including the link return smtpmailer($to, $subject, $message); }
function forgot_username($con) { if (isset($_POST['Submit'])) { $email = $_POST['email']; $check_email_exists = $con->prepare("SELECT username FROM user WHERE email = ?"); $check_email_exists->bind_param("s", $email); $check_email_exists->execute(); $check_email_exists->store_result(); //$data = $check_email_exists->fetch_array(); //$username = $data['username']; //$user_r = mysqli_stmt_get_result($check_email_exists); //$user = mysqli_fetch_array($user_r, MYSQLI_ASSOC); //$username = $user['username']; //$check_email_exists = mysqli_query($con, "SELECT username FROM user WHERE email = '$email' "); $username = utils::mysqli_result(mysqli_query($con, "SELECT username FROM user WHERE email = '{$email}'"), 0, 0); if ($check_email_exists->num_rows >= 1) { $mail = smtpmailer($email, "*****@*****.**", "ETM Automated mail", "Eve Trade Master - login details", "You have recently requested your login details at www.evetrademaster.com. Your username is '{$username}'"); } else { echo "Email not found in our records"; echo "<meta http-equiv='refresh' content='2; url=../pages/forgot_username.php'>"; } } else { echo "Forgot your username? Just type the e-mail associated to your account and we'll send it to you:" . "<br><br>"; ?> <form method="POST" action="forgot_username.php" ><fieldset> <div class="form-group"> <input class="form-control" type = "text" size="30" name="email"> </div> <div class="form-group"> <p align='center'><input type ="Submit" name="Submit" value="Submit" class="btn btn-lg btn-success"></p> </fieldset></form> <?php } }
<?php include "email.php"; $nome = $_POST["nome"]; $sobrenome = $_POST["sobrenome"]; $email = $_POST["email"]; $telefone = $_POST["telefone"]; $msg = $_POST["msg"]; $data_envio = date('d/m/Y'); setHeader(); ?> <div class="body"> <?php if (strlen($_POST['nome'])) { if (smtpmailer("*****@*****.**", "Contato pelo formulario", $msg, $nome, $email, $telefone, $sobrenome, $data_envio)) { echo "Sua mensagem foi enviada com sucesso!"; } else { echo "Ocorreu um erro ao enviar"; } echo "<br><a href='http://fernandoxavierfotografia.zz.mu'>Voltar</a>"; } ?> </div><!--body--> <?php setFooter();
function sendInternalUserMessage($id, $subject, $message, $footer = "", $attachments = array(), $action = "") { $from = "*****@*****.**"; $fromName = "Schokolat"; $qry = "SELECT B.email, B.firstname, B.lastname FROM {$_SESSION['DB_PREFIX']}members B " . "WHERE B.member_id = " . getLoggedOnMemberID(); $result = mysql_query($qry); //Check whether the query was successful or not if ($result) { while ($member = mysql_fetch_assoc($result)) { $from = $member['email']; $fromName = $member['firstname'] . " " . $member['lastname']; } } $qry = "SELECT B.email, B.firstname FROM {$_SESSION['DB_PREFIX']}members B " . "WHERE B.member_id = {$id} "; $result = mysql_query($qry); //Check whether the query was successful or not if ($result) { while ($member = mysql_fetch_assoc($result)) { smtpmailer($member['email'], $from, $fromName, $subject, getEmailHeader() . "<h4>Dear " . $member['firstname'] . ",</h4><p>" . $message . "</p>" . getEmailFooter() . $footer, $attachments); $subject = mysql_escape_string($subject); $message = mysql_escape_string($message); sendMessage($subject, $message, $id, $action); } } else { logError($qry . " - " . mysql_error()); } if (!empty($error)) { echo $error; } }
// Debugar: 1 = erros e mensagens, 2 = mensagens apenas $mail->SMTPAuth = true; // Autenticação ativada $mail->SMTPSecure = 'tls'; // SSL REQUERIDO pelo GMail $mail->Host = 'smtp.live.com'; // SMTP utilizado $mail->Port = 587; // A porta 587 deverá estar aberta em seu servidor $mail->Username = GUSER; $mail->Password = GPWD; $mail->SetFrom($de, $de_nome); $mail->Subject = $assunto; $mail->Body = $corpo; $mail->AddAddress($para); if (!$mail->Send()) { $error = 'Mail error: ' . $mail->ErrorInfo; return false; } else { $error = 'Mensagem enviada!'; return true; } } // Insira abaixo o email que irá receber a mensagem, o email que irá enviar (o mesmo da variável GUSER), o nome do email que envia a mensagem, o Assunto da mensagem e por último a variável com o corpo do email. if (smtpmailer($Email, '*****@*****.**', 'Contato - Slice of Life', 'Recuperacao de Senha', $Vai)) { Header("location:login.html"); // Redireciona para uma página de obrigado. } if (!empty($error)) { echo $error; }
require_once 'template/navigation.php'; if (isset($_POST['adduser']) && UserCan('create_user')) { $username = $_POST['firstname'] . $_POST['lastname']; $username = strtolower($username); $passwd = randomPassword(); $addr = str_replace('users.php', '', $_SERVER['SCRIPT_NAME']); $body = "Hallo " . $_POST['firstname'] . " " . $_POST['lastname'] . ",\n"; $body .= "Sie wurden als Nutzer hinzugefügt. \n"; $body .= "Ihr Nutzername lautet: {$username}\n"; $body .= "Ihr Passwort lautet: {$passwd}\n"; $body .= "Bitte ändern Sie es bei nächster Möglichkeit.\n"; $body .= "Die URL zum Tool lautet: " . $_SERVER['SERVER_ADDR'] . $addr; $passwd = hash('sha512', $passwd); $sql = "INSERT INTO `{$db_data}`.`users` (`userid` , `username`, `groupid` , `email` , `lastname` , `firstname` , `description`, `passwd`)\n VALUES (NULL , '" . $username . "' , '" . $_POST['groupid'] . "' ,'" . $_POST['email'] . "', '" . $_POST['lastname'] . "', '" . $_POST['firstname'] . "' , '" . $_POST['description'] . "' , '" . $passwd . "')"; if (mysqli_query($con, $sql)) { smtpmailer($_POST['email'], 'Du wurdest als Nutzer angelegt', $body); } } $result = mysqli_query($con, "SELECT * FROM users"); if (!UserCan('show_users')) { $error = "<div class=\"col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main\">"; $error .= "<div class=\"alert alert-danger\" role=\"alert\">"; $error .= "Fehler, Du hast nicht die benötigten Recht um Nutzer anzuzeigen."; $error .= "</div>"; $error .= "</div>"; die($error); } ?> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> <?php
// A porta 587 deverá estar aberta em seu servidor $mail->Username = $smtpUsuario; $mail->Password = $smtpSenha; $mail->SetFrom($from, $de_nome); $mail->Subject = $subject; $mail->Body = $corpo; $mail->AddAddress($para); if (!$mail->Send()) { $error = '<div class="sent">Mail error: ' . $mail->ErrorInfo . '</div>'; return false; } else { $error = '<div class="sent">Enviado com sucesso!</div>'; return true; } } if (smtpmailer($para, $from, $de_nome, $subject, $corpo)) { //sent } if (!empty($error)) { echo $error; } } ?> <!-- Formulário --------------------------------- --> <!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="UTF-8"> <meta name="author" content="André Silveira Machado" />
if (!empty($lang)) { include 'lang/' . $lang . '.php'; } else { include 'lang/' . $_COOKIE['lang'] . '.php'; } if (isset($_POST['forgot'])) { $email = mysqli_real_escape_string($con, $_POST['email']); if (!($userid = getUserInfobyMail($email))) { die('Please check the email address you entered.'); } $newpassword = randomPassword(); $newencpasswd = hash('sha512', $newpassword); $sql = "UPDATE `users` SET `passwd` = '{$newencpasswd}' WHERE `users`.`userid` = '{$userid}';"; if (mysqli_query($con, $sql)) { $body = $message['your_new_pass'] . ": " . $newpassword; smtpmailer($email, $message['your_new_pass'], $body); } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Passwort Reset</title> <!-- Bootstrap core CSS --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/signin.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
$matchid = mysql_insert_id(); if (!$result) { logError($qry . " - " . mysql_error()); } for ($i = 0; $i < count($_POST['player']); $i++) { $playerid = $_POST['player'][$i]; $qry = "INSERT INTO {$_SESSION['DB_PREFIX']}matchplayerdetails \n\t\t\t\t\t(\n\t\t\t\t\t\tmatchid, playerid, metacreateduserid, metamodifieduserid, \n\t\t\t\t\t\tmetacreateddate, metamodifieddate\n\t\t\t\t\t)\n\t\t\t\t\tVALUES\n\t\t\t\t\t(\n\t\t\t\t\t\t{$matchid}, {$playerid}, {$memberid}, {$memberid}, \n\t\t\t\t\t\tNOW(), NOW()\n\t\t\t\t\t)"; $result = mysql_query($qry); if (!$result) { logError($qry . " - " . mysql_error()); } } $details = "Match report attached for match on " . $_POST['matchdate']; $file = "uploads/matchcard{$id}" . session_id() . ".pdf"; $report = new MatchCardReport('P', 'mm', 'A4', $matchid); $report->Output($file, "F"); sendTeamMessage($teamid, "Match Report Confirmed", $details, "", array($file)); sendRoleMessage("LEAGUE", "Match Report Confirmed", $details, "", array($file)); if ($_POST['refereescore'] < 50 && $_POST['refereescore'] > 0) { $refname = GetRefereeName($refereeid); $refdetails = "Referee {$refname} has scored {$refereescore}<br><br>Report:<br>" . $_POST['refereeremarks']; smtpmailer(getSiteConfigData()->refereereportemail, "*****@*****.**", $_SESSION['SESS_TEAM_EMAIL'], "Referee Report", $refdetails); } } catch (Exception $e) { logError("Signing image: " . $e->getMessage()); } mysql_query("COMMIT"); header("location: matchconfirm.php?id={$matchid}"); ?>
function forgot_password($con) { if (isset($_POST['Submit'])) { $user = strtolower(mysqli_real_escape_string($con, $_POST['username'])); $email = strtolower(mysqli_real_escape_string($con, $_POST['email'])); $check_email_user = mysqli_query($con, "SELECT password, salt FROM user WHERE username= '******' AND email = '{$email}'") or die(mysqli_error($con)); if (mysqli_num_rows($check_email_user) == 1) { $pw1 = get_random_string("abcdefghijklmnopqrstuwxyz1234567890_!#\$%&=", 7); //create new salt, generate crypt and store new PW and salt $cost = 10; $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.'); $salt = sprintf("\$2a\$%02d\$", $cost) . $salt; $password_final = crypt($pw1, $salt); $mail = smtpmailer($email, "*****@*****.**", "ETM Automated mail", "Eve Trade Master - login details", "You have recently requested a new password at www.evetrademaster.com. Your new password is '{$pw1}'"); $update_pw_salt = mysqli_query($con, "UPDATE user SET password = '******', salt = '{$salt}' WHERE username = '******' ") or die(mysqli_error($con)); if ($update_pw_salt) { } else { echo "Error establishing database connection. Try again later"; } } else { echo "Data doesn't match our records"; } } else { ?> Forgot your password? Type your email and username and we'll send you a new one. <form method="POST" action="forgot_password.php" ><fieldset> <div class="form-group"> Email <input class="form-control" type = "text" size="30" name="email"> </div> <div class="form-group"> Username<input class="form-control" type = "text" size="20" name="username"> </div> <p align='center'><input type ="Submit" name="Submit" value="Submit" class="btn btn-lg btn-success"></p> </fieldset></form> <?php } }
function sendFileUpdateMail($subject, $body) { $to = ['*****@*****.**']; $from = '*****@*****.**'; $from_name = 'VinodY'; smtpmailer($to, $from, $from_name, $subject, $body, $is_gmail = true); }
$taskid = mysqli_real_escape_string($con, $_POST['taskid']); $projectid = getTaskInfobyID($taskid, 'projectid'); $projectmanagermail = getUserInfo(getProjectInfoByID(getTaskInfobyID($taskid, 'projectid'), 'userid'), 'email'); $projectmanagerid = getProjectInfoByID(getTaskInfobyID($taskid, 'projectid'), 'userid'); $sql = "UPDATE `tasks` SET taskstatus = '" . $statusid . "', `lastchange`=CURRENT_TIMESTAMP WHERE taskid ='" . $taskid . "'"; $history = "INSERT INTO `{$db_data}`.`statushistory` (`taskid`, `userid`, `statusid`, `timestamp`) VALUES ('" . $taskid . "', '" . $_SESSION['userid'] . "', '" . $statusid . "', CURRENT_TIMESTAMP);"; mysqli_query($con, $history); if (mysqli_query($con, $sql)) { if (IsChild($taskid) && AllSubTasksDone($taskid) && $statusid == 3) { $updateparent = "UPDATE `tasks` SET taskstatus = '3' WHERE taskid ='" . getTaskInfobyID($taskid, 'parent') . "'"; mysqli_query($con, $updateparent); } elseif (IsChild($taskid) && AllSubTasksDone($taskid) && $statusid != 3) { $updateparent = "UPDATE `tasks` SET taskstatus = '0' WHERE taskid ='" . getTaskInfobyID($taskid, 'parent') . "'"; mysqli_query($con, $updateparent); } if (getProjectStatusInPercent(getTaskInfobyID($taskid, 'projectid')) == 100) { $body = "Hallo " . getUserFullName($projectmanagerid) . ",\n\n"; $body .= "Dies ist eine automatische E-Mail um Ihnen mitzuteilen, dass die letzte Aufgabe in \"" . getProjectInfoByID($projectid, 'projectname') . "\" erledigt wurde."; smtpmailer($projectmanagermail, 'Projekt: ' . getProjectInfoByID($projectid, 'projectname'), $body); } if (getTaskInfobyID($taskid, 'creator') != getTaskInfobyID($taskid, 'userid') && $statusid == 3) { $creator = getTaskInfobyID($taskid, 'creator'); $body = "Hallo " . getUserFullName($creator) . ",\n"; $body .= "Die Aufgabe (" . getTaskInfobyID($taskid, 'taskname') . "), die du " . getUserFullName(getTaskInfobyID($taskid, 'userid')) . " zugewiesen hast wurde erledigt."; smtpmailer(getUserInfo($creator, 'email'), 'Aufgabe: ' . getTaskInfobyID($taskid, 'taskname'), $body); } header("Location: " . $_SERVER['HTTP_REFERER']); } else { die("Bearbeiten fehlgeschlagen"); } }
function gui_mail_validate($email, $validate_code) { $ten_tv = get_value_dk('thanhvien', 'Email', $email, 'Username'); //echo $ten_tv; // $noi_dung = "Xin chào bạn " . $ten_tv . ",<br/>\n\nĐịa chỉ email này đã được sử dụng để đăng ký tài khoản thành viên tại website CẦN THƠ NEW.<br/><br/>\n\nXin vui lòng kích hoạt tài khoản bằng cách truy cập vào đường link dưới đây:<br/><br/>\n\n\t\t<a href=localhost/canthonew/validate.php?c={$validate_code}&e={$email}>" . "Kích hoạt tài khoản của bạn tại đây </a>\n<br/><br/>\nSau khi kích hoạt thành công, hãy cập nhật thông tin cá nhân chính xác để được bảo vệ các quyền lợi và được hỗ trợ tốt nhất khi sử dụng các dịch vụ và tiện ích của Website Cần Thơ New<br/><br/>\nLưu ý:<br/>\n- Nếu trong 24 giờ bạn không kích hoạt tài khoản, hệ thống sẽ tự động hủy tài khoản của bạn.<br/>\n- Đây là email được gửi tự động từ hệ thống. Bạn không cần trả lời thư này. Nếu bạn gặp vấn đề trong khi kích hoạt tài khoản, vui lòng liên hệ CẦN THƠ NEW.<br/><br/>\n\nNếu thư này nằm ở thư mục spam, để những lần sau thư luôn vào Inbox, bạn vui lòng nhấn chuột vào tính năng Not Spam (của Yahoo, Gmail) hoặc di chuyển thư này về thư mục Inbox. <br/><br/>\n\nCảm ơn bạn vì đã trở thành thành viên của CẦN THƠ NEW.<br/>\n\n"; smtpmailer($email, '$newcantho@gmail.com', 'CẦN THƠ NEW', 'KÍCH HOẠT THÀNH VIÊN', $noi_dung); }
function smtpmailer($to, $from, $from_name, $subject, $body) { global $error; $mail = new PHPMailer(); // create a new object $mail->IsSMTP(); // enable SMTP $mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only $mail->SMTPAuth = true; // authentication enabled $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail $mail->Host = 'smtp.gmail.com'; $mail->Port = 465; $mail->Username = GUSER; $mail->Password = GPWD; $mail->SetFrom($from, $from_name); $mail->Subject = $subject; $mail->Body = $body; $mail->AddAddress($to); if (!$mail->Send()) { $error = 'Mail error: ' . $mail->ErrorInfo; return false; } else { $error = 'Message sent!'; return true; } } smtpmailer('*****@*****.**', '*****@*****.**', 'yourName', 'test mail message', 'Hello World!');
$mail->SMTPAuth = true; // Autenticação ativada $mail->SMTPSecure = 'ssl'; // SSL REQUERIDO pelo GMail $mail->Host = 'smtp.gmail.com'; // SMTP utilizado $mail->Port = 465; //587; // A porta 587 deverá estar aberta em seu servidor $mail->Username = GUSER; $mail->Password = GPWD; $mail->SetFrom($de, $de_nome); $mail->Subject = $assunto; $mail->Body = $corpo; $mail->AddAddress($para); if (!$mail->Send()) { $error = 'Mail error: ' . $mail->ErrorInfo; return false; } else { $error = 'Mensagem enviada!'; return true; } } // Insira abaixo o email que irá receber a mensagem, o email que irá enviar (o mesmo da variável GUSER), //o nome do email que envia a mensagem, o Assunto da mensagem e por último a variável com o corpo do email. if (smtpmailer('*****@*****.**', '*****@*****.**', $Nome, $Assunto, $Vai)) { Header("location:http://www.popeteste.com.br/"); // Redireciona para uma página de obrigado. } if (!empty($error)) { echo $error; }
$mail->SMTPAuth = true; // Autenticação ativada $mail->SMTPSecure = 'ssl'; // SSL REQUERIDO pelo GMail $mail->Host = 'smtp.gmail.com'; // SMTP utilizado $mail->Port = 465; // A porta 465 deverá estar aberta em seu servidor $mail->Username = GUSER; $mail->Password = GPWD; $mail->SetFrom($de, $de_nome); $mail->Subject = $assunto; $mail->Body = $corpo; $mail->AddAddress($para); if (!$mail->Send()) { $error = 'Mail error: ' . $mail->ErrorInfo; return false; } else { //$error = 'Mensagem enviada! Verifique seu e-mail!'; return true; } } // Insira abaixo o email que irá receber a mensagem, o email que irá enviar (o mesmo da variável GUSER), //o nome do email que envia a mensagem, o Assunto da mensagem e por último a variável com o corpo do email. if (smtpmailer($destinatario, $remetente, $remetente_nome, $titulo, $Vai)) { Header("../index.php"); // Redireciona para uma página de obrigado. } if (!empty($error)) { echo $error; }
<?php $time = (int) time() - (int) $_COOKIE['nifoSendMail']; if ($_COOKIE['nifoSendMail'] && $time < 60) { echo json_encode(array("result" => $time)); die; } setcookie("nifoSendMail", time(), time() + 600); require_once 'phpmailer/class.phpmailer.php'; require_once 'phpmailer/sendmail.php'; $subject = "Nifo: " . $_POST['Category']; $message .= "Name: " . $_POST['Name'] . ";"; $message .= "Phone: " . $_POST['Phone'] . ";"; $message .= "Email: " . $_POST['Email'] . ";"; $message .= "Text: " . $_POST['Message'] . "."; $result = smtpmailer('*****@*****.**', '*****@*****.**', 'nifo', $subject, $message); if ($result) { echo json_encode(array("result" => $time)); } else { echo json_encode(array("result" => $time)); }
$mail->SMTPAuth = true; // Autenticação ativada $mail->SMTPSecure = 'ssl'; // SSL REQUERIDO pelo GMail $mail->Host = 'smtp.gmail.com'; // SMTP utilizado $mail->Port = 465; // A porta 465 deverá estar aberta em seu servidor $mail->Username = GUSER; $mail->Password = GPWD; $mail->SetFrom($de, $de_nome); $mail->Subject = $assunto; $mail->Body = $corpo; $mail->AddAddress($para); if (!$mail->Send()) { $error = 'Mail error: ' . $mail->ErrorInfo; return false; } else { $error = 'Mensagem enviada!'; return true; } } // Insira abaixo o email que irá receber a mensagem, o email que irá enviar (o mesmo da variável GUSER), //o nome do email que envia a mensagem, o Assunto da mensagem e por último a variável com o corpo do email. if (smtpmailer('*****@*****.**', '$email', 'Nome do Enviador', 'Assunto do Email', $vai)) { Header("location:http://www.dominio.com.br/obrigado.html"); // Redireciona para uma página de obrigado. } if (!empty($error)) { echo $error; }
function sendMail($temp, $SensorDesc) { $subject = "Dosažení teploty : {$temp} °C na zařízení {$SensorDesc}"; $body = "Dosažení teploty : {$temp} °C na zařízení {$SensorDesc} čas:" . date('d.m.Y H:i'); return smtpmailer($GLOBALS["email"], $GLOBALS["from"], $GLOBALS["from_name"], $subject, $body); }
if ($_POST) { $name_user = $_POST['fi_nome']; $email_user = $_POST['fi_email']; $telephone_user = $_POST['fi_telefone']; $curso_1 = $_POST['fi_opcao-curso-1']; $curso_2 = $_POST['fi_opcao-curso-2']; $curso_3 = $_POST['fi_opcao-curso-3']; $para = '*****@*****.**'; $de = $email_user; $de_nome = $name_user; $assunto = 'Formulário de Inscrição - UNIRON - PRONATEC'; $corpo = <<<MSG Um usuário fez inscrição no site do pronatec. <br> A seguir os dados do usuário: <br><br> <strong>Nome:</strong> {$name_user} <br> <strong>Email:</strong> {$email_user} <br> <strong>Telefone:</strong> {$telephone_user} <br><br> Cursos Selecionados: <br><br> <strong>Opção 1:</strong> {$curso_1} <br> <strong>Opção 2:</strong> {$curso_2} <br> <strong>Opção 3:</strong> {$curso_3} <br> MSG; $mail = smtpmailer($para, $de, $de_nome, $assunto, $corpo); if ($mail) { echo json_encode(array('status' => true, 'message' => 'Sua inscrição foi realizada com sucesso.')); } else { echo json_encode(array('status' => false, 'message' => "Sua inscrição não foi realizada. \nTente novamente mais tarde.")); } }
echo "<script>location.href='usuario_cadastrar.php?mensagem=w3-red&texto=O e-mail de login " . $login . " já está sendo usado! Tente utilizar a opção de recuperação de senha.';</script>"; } else { $sql = "INSERT INTO `usuario` (`usu_nome`, `usu_email`, `usu_senha`, `usu_escolaridade`, `cid_codigo`, `usu_descricao`, `usu_data_hora_cad`) \n VALUES ('{$nome}', '{$login}','" . SHA1($senha) . "', '{$escolaridade}', '{$cidade}', '{$descricao}', '{$dataHora}');"; $mysqli->query($sql); $sqlUsu = "SELECT `usu_codigo`\n FROM `usuario` \n WHERE (`usu_email` = '" . $login . "') AND (`usu_senha` = '" . SHA1($senha) . "') \n LIMIT 1"; $queryUsu = $mysqli->query($sqlUsu); if (mysqli_num_rows($queryUsu) > 0) { if (!empty($categoria)) { $N = count($categoria); $resultado = $queryUsu->fetch_assoc(); for ($i = 0; $i < $N; $i++) { if ($i == 1) { $situacao = 'ativo'; } else { $situacao = 'pendente'; } $sqlCategoria = "INSERT INTO `usuario_categoria_usuario` (`usu_codigo`, `cat_usu_codigo`, `cat_usu_situacao`) VALUES ('" . $resultado['usu_codigo'] . "', '" . $categoria[$i] . "', '{$situacao}');"; $mysqli->query($sqlCategoria); } } } $emailmsg = montaMensagem($login, $nome, $senha); $emailret = smtpmailer($login, '*****@*****.**', 'ColabAD', 'Cadastro ColabAD', $emailmsg, 0); echo "<script>location.href='entrar.php?mensagem=w3-green&texto=Cadastro efetuado com sucesso! {$emailret}';</script>"; $mysqli->Close(); die; } } ?>
$mysqli = $conexao; $login = $mysqli->real_escape_string($_POST['login']); $senha = $mysqli->real_escape_string($_POST['senha']); $matricula = $mysqli->real_escape_string($_POST['matricula']); $nome = $mysqli->real_escape_string($_POST['nome']); $email = $mysqli->real_escape_string($_POST['email']); $situacao = $mysqli->real_escape_string($_POST['situacao']); foreach ($_POST['categoria'] as $key => $value) { $categoria[$key] = $value; } //$categoria = $mysqli->fetch_array($_POST['categoria']); $sql = "INSERT INTO `usuario` (`usu_login`, `usu_senha`, `usu_nome`, `usu_email`, `usu_matricula`, `usu_situacao`) \n VALUES ('{$login}', '" . SHA1($senha) . "', '{$nome}', '{$email}', '{$matricula}', '{$situacao}');"; $mysqli->query($sql); //$queryInsert->execute(); $sqlUsu = "SELECT `usu_codigo`\n FROM `usuario` \n WHERE (`usu_login` = '" . $login . "') AND (`usu_senha` = '" . SHA1($senha) . "') \n LIMIT 1"; $queryUsu = $mysqli->query($sqlUsu); if (mysqli_num_rows($queryUsu) > 0) { if (!empty($categoria)) { $N = count($categoria); $resultado = $queryUsu->fetch_assoc(); for ($i = 0; $i < $N; $i++) { $sqlCategoria = "INSERT INTO `usuario_categoria` (`usu_codigo`, `cat_codigo`) VALUES ('" . $resultado['usu_codigo'] . "', '" . $categoria[$i] . "')"; $mysqli->query($sqlCategoria); } } } include "../include/funcoes.php"; $emailmsg = montaMensagem($login, $senha); $emailret = smtpmailer($email, '*****@*****.**', $nome, 'Cadastro Gerenciador TGSI', $emailmsg); header("Location: cadastrar.php?mensagem=Usuário inserido com sucesso! {$emailret}"); die;
function invite_member($email, $userid, $group = '', $groupname = '') { $regcode = get_random_string(); if (empty($group)) { $group = 'NULL'; } $sql = "INSERT INTO `goingdutch`.`register` (`email` ,`userid`, `code` , `group`, `timestamp`)\n VALUES ('" . mysql_real_escape_string(email) . "', {$userid}, '" . mysql_real_escape_string($regcode) . "', {$group}, CURRENT_TIMESTAMP )"; if (!($result = mysql_query($sql))) { return false; } // send email $regcodes = space_code($regcode); $from = '*****@*****.**'; $from_name = 'Going Dutch'; if (!empty($groupname)) { $groupname = 'group "' . $groupname . '"'; } $subject = "Invitation to join Going Dutch {$groupname}"; //$website = 'http://inthere.nl/dutch'; $website = LOGIN_URL; $link = "<a href=\"{$website}?code={$regcode}\">this link</a>"; $html = "Please register using {$link}<br /><br>"; $html .= "Or register on {$website} with this code<br />{$regcodes}"; if (!smtpmailer($email, $from, $from_name, $subject, $html, array('*****@*****.**', 'Do not reply to this address'), 'to')) { echo " something went wrong <br />"; echo $smtpmailer_error; } }
<br>Best customers by profit:<br> <?php getBestCustomersProfit($ids_string, $con); ?> <br>Fastest turnovers:<br> <?php getFastestTurnovers($ids_string, $con); ?> <br>Last 7 days profits:<br> <?php getLastWeekProfits($ids_string, $con); ?> <br>If you found this tool useful, feel free to tip a small amount of ISK to 'Nick Starkey' ingame or to <a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=E92PVNRT3L9EQ'>Paypal</a> to help me keep up with server costs. <br>Note: You are receiving this e-mail because you have subscribed to evetrademaster.com automated reports. If you do not wish to recieve any more reports, click <a href='www.evetrademaster.com/pages/unsubscribe.php?user=<?php echo $username; ?> &email=<?php echo $email; ?> '>here</a> to unsubscribe. <?php $body = ob_get_contents(); ob_end_clean(); $from = "*****@*****.**"; $from_name = "ETM"; $subject = "Weekly earnings report for " . $today; $to = $email; smtpmailer($to, $from, $from_name, $subject, $body); }
$data['username'] = strip_tags($_POST['username']); $data['password'] = md5(md5($_POST['password'])); $data['password2'] = md5(md5($_POST['re_password'])); $data['about'] = strip_tags($_POST['about']); $data['last_activity'] = date("Y-m-d H:i:s", time()); $avatar = md5($data['last_activity'] . $data['email']); $temp = explode(".", $_FILES["avatar"]["name"]); $extension = end($temp); //upload Avatar if ($user->validateUser($data)) { if (isset($_FILES['avatar'])) { if ($user->uploadAvatar($avatar)) { $data['avatar'] = $avatar . '.' . $extension; } else { $data['avatar'] = 'gravatar.jpg'; } } else { $data['avatar'] = 'gravatar.jpg'; } $token = md5("ournextpresAkhil@" . $data['name'] . $data['password'] . $data['email'] . "ournextpresAkhil@"); if (smtpmailer($data['email'], "*****@*****.**", "AKHIL_REDDY @BITS_QUORA", "Mail confirmation for BITS-QUORA", $data['avatar'], $data['name'], $token)) { if ($user->register($data)) { echo "Registered Successfully.Please verify the mail."; } else { echo "Sorry, we cannot register you right now. Please try later."; } } else { echo 'Couldn\'t register at this time. Please try later.'; } } }
$subject = $_SERVER['argv'][4]; $body = $_SERVER['argv'][5]; $replyto = $_SERVER['argv'][6]; $sendas = $_SERVER['argv'][7]; //print ("TEST\n"); //print ("to: {$to}\n"); //print("from: {$from}\n"); //print("from_name: {$from_name}\n"); //print("subject: {$subject}\n"); //print("body: {$body}\n"); //print("replyto: {$replyto}\n"); //print("sendas: {$sendas}\n"); $date = date('l jS \\of F Y h:i:s A'); //logToFile($date); global $smtpmailer_error; smtpmailer($to, $from, $from_name, $subject, $body, $replyto, $sendas); //logToFile($smtpmailer_error); function logToFile($string) { $myFile = "mailLog.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); fwrite($fh, $string . "\n"); fclose($fh); } //define('GUSER', '*****@*****.**'); // Gmail username //define('GPWD', 'nannhnapniboctio '); // Gmail password function smtpmailer($to, $from, $from_name, $subject, $body, $replyto = '', $sendas = 'to') { $guser = '******'; $gpwd = 'nannhnapniboctio'; if (empty($sendas)) {
$mail->Port = 465; // A porta 465 deverá estar aberta em seu servidor $mail->Username = GUSER; $mail->Password = GPWD; $mail->SetFrom($de, $de_nome); $mail->Subject = $assunto; $mail->Body = $corpo; $mail->AddAddress($para); if (!$mail->Send()) { $error = 'Mail error: ' . $mail->ErrorInfo; return false; } else { ?> <script> alert("Cadastro realizado com sucesso acesse seu email e ative o usuário!"); window.location = 'index.php'; </script> <?php return true; } } // Insira abaixo o email que irá receber a mensagem, o email que irá enviar (o mesmo da variável GUSER), //o nome do email que envia a mensagem, o Assunto da mensagem e por último a variável com o corpo do email. if (smtpmailer($Email, '$Email', 'Nome do Enviador', $Email, $Vai)) { //Header("location:http://localhost:8080/"); // Redireciona para uma página de obrigado. } if (!empty($error)) { echo $error; } } }
} else { $error = 'Confirmation Mail sent to the the provided mail!'; return true; } } $user = new User(); $db = new Database(); if (isset($_POST['do_forgot'])) { if (!empty($_POST['f_email'])) { $db->query("SELECT * FROM users WHERE email=:email AND status='1'"); $db->bind("email", $_POST['f_email']); $result = $db->single(); if ($db->rowCount() == 1) { $pass = $result->password; $pass = substr($pass, 0, 6); if (smtpmailer($result->email, "*****@*****.**", "AKHIL REDDY@ BITS QUORA", "Password reset for your account", $result->avatar, $result->name, $result->username, $pass)) { $db->query("UPDATE users SET password=:pass WHERE email=:email"); $db->bind("pass", md5(md5($pass))); $db->bind("email", $result->email); $db->execute(); echo 'We have sent your accout details to your mail.'; } else { echo 'Please try after some time'; } } else { echo 'Please register this email first.'; } } else { echo 'please provide us your email'; } } else {