// generate new id $sqlr = "SELECT max(idmessage) as newid from message "; $resultr = mysql_query($sqlr); if (mysql_num_rows($resultr) < 1) { $kode = 1; } else { $rowr = mysql_fetch_array($resultr); $kode = $rowr['newid'] + 1; } $query = "INSERT INTO messages "; $query .= "VALUES('{$kode}','1111111111','{$idmember}','{$message}','inputdate','1')"; $result = mysql_query($query); // sending email to customer related about the action $emailsender = "*****@*****.**"; $emailreceiver = $email; $namapengirim = "Roripon.com"; $namapenerima = $namamember; $subject = "Confirmation about your roricoins\tin roripon.com"; echo $isiemail = "\n\t<table width=\"625\" border=\"0\" align=\"center\" style=\"border:1px solid green\">\n\t <tr>\n\t\t<td colspan='2'> </td>\n\t </tr>\n\t <tr>\n\t\t<td align=\"right\">\n\t\t\t<img width=\"187\" height=\"88\" src=\"http://www.roripon.com/config/images/newtoplogo.png\" align=\"right\" />\n\t\t</td>\n\t\t<td width=\"605\"><p align=\"center\">\n\t\t\t<strong>PT. RORI PON</strong><br />\n\t\t\tJalan Dharmahusada Indah Utara Blok U/VI no. 319 Surabaya<br />\n\t\t\tTlp. 031 83222289/99, 031 71998877.<br/> \n\t\t\tEmail cs@roripon.com</p>\n\t\t</td>\n\t </tr>\t \n\t <tr>\n\t\t<td colspan='2'><hr color='green'></td>\n\t </tr>\n\t <tr>\n\t\t<td colspan='2'><i>You got this message via Roripon.com</i></td>\n\t </tr>\n\t <tr>\n\t\t<td align='left' colspan='2'>From : {$namapengirim}" . "(" . $emailsender . ")</td>\n\t </tr> \n\t <tr>\n\t\t<td align='left' colspan='2'>Subject : {$subject}</td>\n\t </tr> \n\t <tr>\n\t\t<td colspan='2'> </td>\n\t </tr> \n\t <tr>\n\t\t<td colspan='2'>" . $greet1 . "\n\t\t</td>\n\t </tr>\n\t</table>"; $sender = new MailSender(); $sender->set_from($emailsender); $sender->set_from_name($namapengirim); $sender->set_message($isiemail); $sender->set_subject($subject); $sender->set_to($emailreceiver); $sender->set_to_name($namapenerima); $sender->send(); if ($sender) { $pesan = "An email has been sent to member's email address. Update " . $prod . " success."; } echo "<script>alert(\"{$pesan}\");window.location='javascript:javascript:history.go(-2)';</script>";
$CB->buildChartByCustomer($RSByoID); $CB->buildChartByTechnician($RSByTechnician); $CB->buildChartByMonth($RSByMonth); // # OK $SR->status = ServiceResponse::STATUS_OK; echo json_encode($SR); } catch (Exception $e) { // # No way $log->addError($e->getMessage()); } }); // # Mail sender route $router->map('GET', 'sender', function () use($PM, $log) { // # Mail sender instance $MS = new MailSender(); $SR = $MS->send(); // # Response echo json_encode($SR); }); // # CONFIG Page ajax ROUTES // # Get recipients API $router->map('GET', 'recipients', function () { echo json_encode(file_get_contents("config/mail/recipients")); }); // # Get technicians list $router->map('GET', 'technicians', function () use($DAOConn, $log) { try { // # Connect to db $DAO = new DAO($DAOConn, $log, array()); echo json_encode($DAO->getTechnicians()); } catch (Exception $e) {
$_REQUEST["cc"] = $Opt["emailCc"] ? $Opt["emailCc"] : ""; } else { $_REQUEST["cc"] = Text::user_email_to(Contact::site_contact()); } } if (isset($_REQUEST["replyto"]) && $Me->privChair) { $_REQUEST["replyto"] = simplify_whitespace($_REQUEST["replyto"]); } else { $_REQUEST["replyto"] = defval($Opt, "emailReplyTo", ""); } // Check or send if (defval($_REQUEST, "loadtmpl") || defval($_REQUEST, "cancel") || defval($_REQUEST, "psearch")) { /* do nothing */ } else { if (defval($_REQUEST, "send") && !$recip->error && check_post()) { MailSender::send($recip); } else { if ((@$_REQUEST["check"] || @$_REQUEST["group"] || @$_REQUEST["ungroup"]) && !$recip->error && check_post()) { MailSender::check($recip); } } } if (isset($_REQUEST["monreq"])) { $plist = new PaperList(new PaperSearch($Me, ["t" => "req", "q" => ""]), ["list" => true, "foldable" => true]); $ptext = $plist->table_html("reqrevs", ["header_links" => true, "table_id" => "foldpl"]); if ($plist->count == 0) { $Conf->infoMsg("You have not requested any external reviews. <a href='", hoturl("index"), "'>Return home</a>"); } else { echo "<h2>Requested reviews</h2>\n\n", $ptext, "<div class='info'>"; if ($plist->any->need_review) { echo "Some of your requested external reviewers have not completed their reviews. To send them an email reminder, check the text below and then select “Prepare mail.” You’ll get a chance to review the emails and select specific reviewers to remind.";
} array_push($_SESSION['messages'], $message); // Redirect user to home page header("Location: index.php"); ob_end_flush(); die; } if ($result === -1) { $dbconn->disconnect(); $message = array('content' => 'Yêu cầu không hợp lệ!', 'type' => 'error'); if (!isset($_SESSION['messages'])) { $_SESSION['messages'] = array(); } array_push($_SESSION['messages'], $message); // Redirect user to home page header("Location: index.php"); ob_end_flush(); die; } // Send mail $mailParams = array('to' => $email, 'subject' => 'LintinZone: Ngừng đăng ký tin tức :-(', 'message' => array('{receiver}' => $dbconn->getContactName($email), '{home_link}' => 'http://' . $_SERVER['SERVER_NAME'] . '/index.php', '{support_link}' => 'http://' . $_SERVER['SERVER_NAME'] . '/contact.php')); $sender = new MailSender($dbconn); $sender->send($mailParams, 'unsubscribe-vi', 'html'); $dbconn->disconnect(); $message = array('content' => 'Bạn đã ngừng nhận tin từ LintinZone :-(.', 'type' => 'success'); if (!isset($_SESSION['messages'])) { $_SESSION['messages'] = array(); } array_push($_SESSION['messages'], $message); header("Location: index.php"); ob_end_flush();
public function testReportMailSender() { $sender = new MailSender; $sender->addRecipient('domainezz.com Admin <*****@*****.**>'); $sender->send('toto','titi'); $mailData = Stato_StaticTransport::getMailQ(); $this->assertEquals('Rapport d\'exploitation : titi',$mailData[0]['subject']); $this->assertEquals("domainezz.com Admin <*****@*****.**>", $mailData[0]['to']); $this->assertContains("Rapport d'exploitation du traitement \"titi\" :\n" ."\n" ."toto",$mailData[0]['content']); }
//-------------------------------------- $smtp['host'] = MAIL_SMTP; $smtp['port'] = 25; $smtp['auth'] = false; $mail = new MailSender($smtp); $mail->setFrom(MAIL_FROM); $mail->setTo(MAIL_TO); // 話題ID、コメントIDがブランクの場合は別アドレスへ if (empty($_POST['t']) == true && empty($_POST['m']) == true) { $mail->setTo(MAIL_TO_PARAMS_NG); } $hostname = @exec('hostname'); $today = date('Y/m/d H:i:s'); $mail->setSubject("[{$hostname}] CGM違反報告 ({$today})"); $mail->send($str); // urlが取得出来ない場合はリダイレクトしない //↓↓===========nm00142 start================================ //↓↓if (empty($_POST['url']) == false) { //↓↓ $url = base64_decode(urldecode($_POST['url'])); //↓↓ header("Location: {$url}#cgm-01"); //↓↓} if (empty($_POST['name']) == false) { $name = base64_decode($_POST['name']); $uri = base64_decode($_POST['uri']); if (strstr($uri, "#cgm-01") == false) { $uri = $uri."#cgm-01"; } $url = "http://".$name.$uri; header("Location: {$url}"); }
if (!isset($_SESSION['messages'])) { $_SESSION['messages'] = array(); } array_push($_SESSION['messages'], $message); // Redirect user to home page header("Location: index.php"); ob_end_flush(); } // Generate an unique key for email confirmation. $key = sha1(uniqid(rand())); // 40 characters $result = $dbconn->sendVerification($email, $key); // Send mail $mailParams = array('to' => $email, 'subject' => 'LintinZone: Comfirm email subscription', 'message' => array('{receiver}' => !empty($name) ? $name : 'my friend', '{confirm_link}' => 'http://' . $_SERVER['SERVER_NAME'] . '/en/confirm.php?key=' . $key . '&email=' . $email . '&lang=en', '{support_link}' => 'http://' . $_SERVER['SERVER_NAME'] . '/en/contact.php', '{home_link}' => 'http://' . $_SERVER['SERVER_NAME'] . '/en/index.php')); $sender = new MailSender($dbconn); $sender->send($mailParams, 'confirm-en', 'html'); // If verification key is stored... if ($result) { $_SESSION['email'] = $email; $message = array('content' => 'An email confirmation has been sent to your email address.', 'type' => 'success'); } else { $dbconn->rollback(); $message = array('content' => 'Oops, an error has occurred! Please try again.', 'type' => 'error'); } // Disconnect after executing query. $dbconn->disconnect(); // Push message to message holder. if (!isset($_SESSION['messages'])) { $_SESSION['messages'] = array(); } array_push($_SESSION['messages'], $message);
array_push($_SESSION['messages'], $message); // Redirect user to home page header("Location: index.php"); ob_end_flush(); die; } $unsubscribe = sha1(uniqid(rand())); if (!$dbconn->confirmEmail($email, $key, $unsubscribe)) { $dbconn->disconnect(); $message = array('content' => 'Quá trình xử lý xảy ra lỗi! Xin vui lòng thử lại.', 'type' => 'error'); if (!isset($_SESSION['messages'])) { $_SESSION['messages'] = array(); } array_push($_SESSION['messages'], $message); // Redirect user to home page header("Location: index.php"); ob_end_flush(); die; } // Send mail $mailParams = array('to' => $email, 'subject' => 'LintinZone: Chào mừng bạn đến với LintinZone', 'message' => array('{receiver}' => $dbconn->getContactName($email), '{unsubscribe_link}' => 'http://' . $_SERVER['SERVER_NAME'] . '/unsubscribe.php?key=' . $key . '|' . $unsubscribe . '&email=' . $email . '&lang=vi', '{support_link}' => 'http://' . $_SERVER['SERVER_NAME'] . '/contact.php', '{home_link}' => 'http://' . $_SERVER['SERVER_NAME'] . '/index.php')); $sender = new MailSender($dbconn); $sender->send($mailParams, 'greeting-vi', 'html'); $dbconn->disconnect(); $message = array('content' => 'Chào mừng bạn đến với LintinZone.', 'type' => 'success'); if (!isset($_SESSION['messages'])) { $_SESSION['messages'] = array(); } array_push($_SESSION['messages'], $message); header("Location: index.php"); ob_end_flush();