public function send($email)
 {
     $mail = $this->App->get('Mailer');
     $mail->addAddress($email, 'Hello World!');
     //$template = get_view('emails/welcome');
     $mail->addAttachment(uploaded_file('demo.png'), 'Demo attachment');
     // Optional name
     $mail->Subject = 'Here is the subject';
     $mail->Body = view('emails/demo');
     $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
     if (!$mail->send()) {
         echo 'Message could not be sent.';
         echo 'Mailer Error: ' . $mail->ErrorInfo;
     } else {
         echo 'Message has been sent';
     }
 }
Exemplo n.º 2
0
 function edit_config()
 {
     $this->isset_cookie();
     $d = date("Y-m-d H:i:s");
     require_once MANAGE_MOD . 'uploaded_file.php';
     $path = "/data/config_doc/";
     $doc_src = uploaded_file($this->table_name('img'), 'original_src', 'file_url', $path);
     if ($_GET['id'] != '') {
         $id = $_GET['id'];
         $sql = "update " . $this->table_name('config') . " set con_name='" . $_POST['con_name'] . "' where con_id='{$id}'";
         $a = mysql_query($sql, $this->conn);
         if ($_POST['edit_doc'] == 1) {
             $img_id = $_POST['img_id'];
             $sql = "select * from " . $this->table_name('img') . " where img_id='{$img_id}'";
             $product = getFetchAll($sql, $this->conn);
             if (!empty($product)) {
                 foreach ($product as $k => $v) {
                     @unlink('.' . $v['original_src']);
                 }
             }
             $sql = "delete from " . $this->table_name('img') . " where img_id='{$img_id}'";
             $a = mysql_query($sql, $this->conn);
         }
         if (!empty($doc_src)) {
             $sql = "insert into " . $this->table_name('img') . "(type_id,type,img_title,order_by,original_src,add_by ,add_time,edit_by) values('" . $id . "','CON','" . $_POST['img_name'] . "','" . $_POST['img_by'] . "','{$doc_src}','" . $_SESSION[$this->shop_name]['h_id'] . "','" . $d . "','" . $_SESSION[$this->shop_name]['h_id'] . "')";
             $b = mysql_query($sql, $this->conn);
         }
         if ($a) {
             js_redir('index.php?a=admin&m=main_right');
         } else {
             js_alert('修改失败,请联系系统管理员');
         }
     } else {
         js_alert_redir('登录错误请重新再试', 'index.php?a=main&m=login');
     }
 }
Exemplo n.º 3
0
 function edit_img()
 {
     isset_cookie();
     if (isset($_GET['f_id'])) {
         $f_id = $_GET['f_id'];
         $title = $this->specifyChar($_POST['title']);
         $url = $this->specifyChar($_POST['url']);
         $edit_doc = $this->specifyChar($_POST['edit_doc']);
         $detail = $this->specifyChar($_POST['detail']);
         if ($edit_doc == "1") {
             require_once MANAGE_MOD . 'uploaded_file.php';
             $path = "/data/img_doc/";
             $doc_src = uploaded_file('aich_product', 'doc_src', 'file_url', $path);
             $sql_i = "img_src='{$doc_src}',";
         } else {
             $sql_i = "";
         }
         $sql_o = "update aich_img " . "set title='{$title}', " . "url='{$url}'," . $sql_i . " " . "detail='{$detail}' " . "where i_id='{$f_id}' ";
         $o = mysql_query($sql_o, $this->conn);
         //echo $sql_o;
         if ($o) {
             $this->index();
         } else {
             js_alert('订单flash失败,请联系系统管理员');
         }
     } else {
         js_alert_redir('登录错误请重新再试', 'index.php?a=main&m=login');
     }
 }