Example #1
0
 function handler_sendEmailBefore($mail, &$to, &$subject, &$body)
 {
     if (!C("plugin.SMTP.server")) {
         return;
     }
     $saemail = new SaeMail();
     $saemail->setOpt(array('content_type' => 'HTML'));
     $prefix = '';
     $tls = false;
     if (C("plugin.SMTP.auth") == 'ssl') {
         $prefix = 'ssl://';
         $tls = false;
         //Can't have SSL and TLS at once
     } elseif (C("plugin.SMTP.auth") == 'tls') {
         $tls = true;
         //tls doesn't use a prefix
     }
     return $saemail->quickSend($to, $subject, $body, C("plugin.SMTP.username"), C("plugin.SMTP.password"), C("plugin.SMTP.server"), C("plugin.SMTP.port"), $tls);
     /*$mail->IsSMTP();
     		$mail->SMTPAuth   = true;
     		if (C("plugin.SMTP.auth")) $mail->SMTPSecure = C("plugin.SMTP.auth");
     		$mail->Host       = C("plugin.SMTP.server");
     		$mail->Port       = C("plugin.SMTP.port");
     		$mail->Username   = C("plugin.SMTP.username");
     		$mail->Password   = C("plugin.SMTP.password");
     		*/
 }
Example #2
0
function SaeMailSendHtml($ToAddress, $Title = '', $HtmlContent = '', $AttachFile = array())
{
    $mail = new SaeMail();
    if (is_array($AttachFile) && $AttachFile !== array()) {
        $mail->setAttach($AttachFile);
    }
    $mail->setOpt(array("content_type" => "HTML"));
    $result = $mail->quickSend($ToAddress, $Title, $HtmlContent, Sae_Mail_From_Address, Sae_Mail_From_Password);
    return $result;
    //示例代码:
    //var_dump(SaeMailSendHtml('*****@*****.**','标题','<A href="http://www.moonlord.cn">正文</A>',array(  '附件.txt' => '这里是附件的二进制数据' , '附件.png' =>file_get_contents("https://www.baidu.com/img/bdlogo.png") )));
}
Example #3
0
 public function sendMail()
 {
     $mailbox = $_POST['mailbox'];
     $title = $_POST['title'];
     $content = $_POST['content'];
     $mail = new SaeMail();
     //$mail->setAttach( array("my_photo.jpg" => "照片的二进制数据" ));
     $ret = $mail->quickSend($mailbox, $title, $content, "*****@*****.**", "jjaazz901222");
     $mail->clean();
     if ($ret === false) {
         var_dump($mail->errno(), $mail->errmsg());
     } else {
         // 更新日志
         //=================
         $data['module'] = '后台管理-邮件';
         $data['operation'] = '发送邮件:mailbox=' . $mailbox . " title=" . $title;
         $data['update_user'] = $_SESSION['tennis-user']['id'];
         $data['ip'] = $this->getIP();
         $log = M('operation_log');
         $log->add($data);
         //=================
         $this->success('发送成功!', '/');
     }
 }
Example #4
0
$ekv->init();
$d=date('Y-m-d H:i:s');
$mail = new SaeMail(); 
$smtp_user='******';
$smtp_pass='******';
$ret = $kv->pkrget('web_', 3);
foreach($ret as $arr => $url){
$url='http://'.$url;
$tags = @get_meta_tags( $url );  
if($tags['saecheckweb'] == 'www.lijingquan.net'){  
	$ret=$ekv->get('fail_'.$url);
	if ($ret == '1'){
	echo $ret;
	}else{
    $mto=$kv->get('mail_'.$url);
    $mail->quickSend($mto,'网站恢复正常!','你的网站'.$url.'已经进入正常状态,并处于监控模式!更多功能,正在开发!欢迎访问我的博客:www.lijingquan.net',$smtp_user,$smtp_pass);
    $mail->clean();
    $ekv->set('fail_'.$url, '1');
    }
}else{  
	$ret=$ekv->get('fail_'.$url);
	if ($ret == '0'){
	echo $ret;
	}else{
    $mto=$kv->get('mail_'.$url);
    $mail->quickSend($mto,'网站发现异常!','你的网站'.$url.'已经进入正常状态,并处于监控模式!更多功能,正在开发!欢迎访问我的博客:www.lijingquan.net',$smtp_user,$smtp_pass);
    $mail->clean();  
    $ekv->set('fail_'.$url, '0');
    }
} 
  echo '<br />';
 public function reply()
 {
     $user = $_SESSION['tennis-user'];
     if ($user != null) {
         if ($user['is_forbidden'] == 1) {
             $this->error('很抱歉,言多必失,您已被封印!
             解封日期请查看用户中心,如有必要请联系管理员!');
         }
     } else {
         $this->error('很遗憾,您还未登录哟?!');
     }
     $User = M("User");
     $userList = $User->where('id=' . $_POST['user_id'])->getField('id, username, mailbox');
     $data['invitation_id'] = $_POST['id'];
     $data['type'] = $_POST['type'];
     $data['user_id'] = $_SESSION['tennis-user']['id'];
     $data['comment'] = "回复" . $userList[$_POST['user_id']]['username'] . ":" . $_POST['comment'];
     $invitation_comment = M('invitation_comment');
     $result = $invitation_comment->add($data);
     if ($result) {
         // 更新日志
         //=================
         $data['module'] = '约球';
         $data['operation'] = '回复球友:id=' . $_POST['id'] . "user_id:" . $_POST['user_id'];
         $data['update_user'] = $_SESSION['tennis-user']['id'];
         $data['ip'] = $this->getIP();
         $log = M('operation_log');
         $log->add($data);
         //=================
         $this->updateScoreAndExp(6);
         // 发送邮件
         // ==========================================================
         $link = "http://tenniser.sinaapp.com/index.php/Invitation/invite_detail?type=" . $_POST['type'] . "&id=" . $_POST['id'] . "#" . $result;
         $mail = new SaeMail();
         //$mail->setAttach( array("my_photo.jpg" => "照片的二进制数据" ));
         $ret = $mail->quickSend($userList[$_POST['user_id']]['mailbox'], "网动青春约球回复", "尊敬的用户:\n                您好!球友 " . $_SESSION['tennis-user']['username'] . " 在您的约球贴中回复了您哟~\n                内容如下:" . $data['comment'] . "\n                访问此链接查看详情:" . $link . "\n                \n                \n                \t\t\t爱网球,爱青春,你我同行。——网动青春", "*****@*****.**", "jjaazz901222");
         $mail->clean();
         // ==========================================================
         $this->success('回复成功!');
     } else {
         $this->success('回复失败!');
     }
 }
Example #6
0
function SendMail($to = '', $subject = '', $body = '')
{
    $mail = new SaeMail();
    $ret = $mail->quickSend($to, $subject, $body, SEND_EMAIL, SEND_EMAIL_PWD);
    if ($ret === false) {
        return false;
    }
    return true;
}
Example #7
0
function send_sae_mail($to, $title, $content)
{
    $mail = new SaeMail();
    $ret = $mail->quickSend($to, $title, $content, "*****@*****.**", "", "smtp.163.com", 25);
}
 public function attachmail()
 {
     $a = 0;
     if (!empty($_FILES)) {
         //
         // var_dump($_FILES);
         import("@.ORG.UploadFile");
         $config = array('allowExts' => array('jpg', 'gif', 'png'), 'savePath' => './Public/upload/', 'saveRule' => 'time');
         $upload = new UploadFile($config);
         $upload->imageClassPath = "@.ORG.Image";
         $upload->thumb = true;
         $upload->thumbMaxHeight = 100;
         $upload->thumbMaxWidth = 100;
         if (!$upload->upload()) {
             $this->error($upload->getErrorMsg());
         } else {
             $info = $upload->getUploadFileInfo();
             $this->assign('filename', $info[0]['savename']);
             //模版引用变量{$filename}
             //$GLOBALS['image'] = $info[0]['savename'];
             //抓				取			图			像
             $f = new SaeFetchurl();
             //  var_dump($info[0]['savename']);
             // var_dump($info);
             // var_dump($a);
             $img_data = $f->fetch("http://thinkfortest-public.stor.sinaapp.com/upload/" . $info[0]['savename']);
             $img = new SaeImage();
             $img->setData($img_data);
             $new_data = $img->exec();
             //var_dump($new_data);
             $a = 1;
         }
     }
     if (isset($_POST['sub1'])) {
         $subject = $_POST['subject'];
         $content = $_POST['content'];
         //现在暂不支持gmail邮箱和附件上传,建议使用新浪邮箱测试。注意需要开启你邮箱的smtp功能。
         /*            $f = new SaeFetchurl();
                     var_dump($GLOBALS['image']);
                     var_dump($a);
                     $img_data = $f->fetch( "http://thinkfortest-public.stor.sinaapp.com/upload/".$GLOBALS['image']);
                     //$img = file_get_contents('http://www.baidu.com/img/bdlogo.png');
                     //var_dump($img_data);
                     $img = new SaeImage();
                     $img->setData( $img_data );
                     $new_data = $img->exec();*/
         //var_dump($new_data);
         $mail = new SaeMail();
         if ($a = 1) {
             $mail->setAttach(array($info[0]['name'] => $new_data));
         }
         $ret = $mail->quickSend('*****@*****.**', $subject, $content, '*****@*****.**', 'wsxhq850687192');
         if ($ret === false) {
             var_dump($mail->errno(), $mail->errmsg());
         } else {
             echo "邮件发送成功!";
         }
     }
     $this->display();
 }
Example #9
0
 public function mail()
 {
     //现在暂不支持gmail邮箱和附件上传,建议使用新浪邮箱测试。注意需要开启你邮箱的smtp功能。
     $mail = new SaeMail();
     $ret = $mail->quickSend('*****@*****.**', '邮件标题', '邮件内容', '*****@*****.**', '123456');
     if ($ret === false) {
         var_dump($mail->errno(), $mail->errmsg());
     } else {
         echo "邮件发送成功,请更改源码,将邮箱改为自己的测试";
     }
 }
Example #10
0
function send_mail($email, $subject, $content)
{
    if (c('on_sae')) {
        $m = new SaeMail();
        $m->quickSend($email, $subject, $content, c('smtp_account'), c('smtp_password'), c('smtp_server'), c('smtp_port'));
        return $m->errmsg();
    } else {
        return @mail($email, $subject, $content);
    }
}
Example #11
0
 public function signup()
 {
     if (count($_POST) > 0) {
         $username = htmlspecialchars($_POST['username']);
         $email = htmlspecialchars($_POST['email']);
         $User = M("User");
         $condition['name'] = $username;
         $condition["email"] = $email;
         $condition["_logic"] = "OR";
         $res = $User->where($condition)->select();
         if (count($res) > 0) {
             $this->assign("error_message", "该用户已存在,请登录");
             $this->display('index');
         } else {
             $data['name'] = htmlspecialchars($_POST['username']);
             $data['email'] = htmlspecialchars($_POST['email']);
             $data['password'] = md5(htmlspecialchars($_POST['password']));
             $data['token'] = md5($_POST['username'] . $_POST['email'] . $_POST['password']);
             $phptime = time();
             $mysqltime = date("Y-m-d H:i:s", $phptime);
             $data['time'] = $mysqltime;
             $data['status'] = '0';
             $res = $User->add($data);
             $mail = new SaeMail();
             $token = $data['token'];
             if (IS_SAE) {
                 # code...
                 $mail_body = "亲爱的" . $username . ":感谢您在我站注册了新账号。http://cruise.sinaapp.com/index.php/Index/verify?token=" . $token;
             } else {
                 $mail_body = "亲爱的" . $username . ":感谢您在我站注册了新账号。http://www.sae.com/index.php/Index/verify?token=" . $token;
             }
             $ret = $mail->quickSend($data['email'], 'Photo 注册验证', $mail_body, '*****@*****.**', 'sxs@19901202');
             if ($ret === false) {
                 var_dump($mail->errno(), $mail->errmsg());
             } else {
                 //echo "邮件发送成功,请更改源码,将邮箱改为自己的测试";
                 $logincookie = md5($_POST['username'] . $_POST['password']);
                 $domain = $_SERVER['HTTP_HOST'] != 'localhost' ? $_SERVER['HTTP_HOST'] : false;
                 setcookie('login', $logincookie, time() + 60 * 60 * 24 * 365, '/', $domain, false);
                 $stat = M("stat");
                 $res = $User->where($condition)->limit(1)->select();
                 $_SESSION['uid'] = $res[0]['uid'];
                 $data['uid'] = $res[0]['uid'];
                 $data['cookie'] = $logincookie;
                 $data['status'] = "login";
                 $stat->add($data);
                 $this->assign('error_message', "注册成功,请登录");
                 $this->assign('signup', 0);
                 $this->redirect('Photo/index', '', 0, '');
                 //$this->display('index');
             }
         }
     } else {
         $_global_arr['signup'] = 1;
         $this->assign('signup', 1);
         $this->display('index');
     }
 }
Example #12
0
 public function getBackPasswordSubmit()
 {
     $mailbox = $_POST['mailbox'];
     $condition['mailbox'] = $mailbox;
     $User = M('User');
     $result = $User->where($condition)->getField("mailbox, password");
     if ($result) {
         $mail = new SaeMail();
         //$mail->setAttach( array("my_photo.jpg" => "照片的二进制数据" ));
         $ret = $mail->quickSend($mailbox, "网动青春密码找回", "尊敬的用户:\n                您好!这是您网动青春官方网站的账户密码(" . $result[$mailbox] . "),请妥善保管,如有必要可在用户中心进行修改。感谢您的支持与关注!\n                \n                \t\t\t爱网球,爱青春,你我同行。——网动青春", "*****@*****.**", "jjaazz901222");
         $mail->clean();
         if ($ret === false) {
             var_dump($mail->errno(), $mail->errmsg());
         } else {
             $this->success('发送成功,请注意查收!', '/');
         }
     } else {
         $this->error('该邮箱未注册!');
     }
 }
Example #13
0
VALUES ('$_POST[element_7]', '$_POST[element_1]', '$_POST[element_4]')");

mysql_close($con);

echo "已经收录!";

    $mail = new SaeMail();
    $mail->quickSend( 
        $_POST[element_1] ,
        "天气预报程序" ,
     "你的设置已经成功!@淡淡清香弥漫世界" ,
        "用户名密码@gmail.com" ,
        "用户名密码" 
    );

  } };
  
  if ($_POST[element_8] == 1){
    $mail = new SaeMail();
    $mail->quickSend( 
        "*****@*****.**" ,
        "天气预报程序帮助者信件" ,
     "我的邮箱是:".$_POST[element_1] ,
        "用户名密码@gmail.com" ,
        "用户名密码" 
    );
    echo '<br />你的帮助申请已经发送到开发者邮箱,如需了解更多请新浪微博<a href=http://weibo.com/gdxkc>@淡淡清香弥漫世界</a>!';
  }

?>
Example #14
0
    $focus = new Users();
    $new_password = $focus->encrypt_password($pass);
    $user_hash = strtolower(md5($pass));
    //change pwd to new pwd
    $query = "UPDATE ec_users SET user_password='******', user_hash='{$user_hash}' where id='{$id}'";
    $adb->query($query);
    $mail = new SaeMail();
    $subject = "找回密码";
    $content = "尊敬的用户,您好,易客CRM已经收到您的找回密码请求,现已将您的密码重置为:" . $pass . ",请重新登录后修改.";
    global $log;
    $log->info($content);
    $from_email = "*****@*****.**";
    $pwd = "c3crm321";
    $server_name = "smtp.sina.com";
    $server_port = "25";
    $ret = $mail->quickSend($user_name, $subject, $content, $from_email, $pwd, $server_name, $server_port);
    if ($ret === false) {
        $errMsg = $mail->errmsg();
        die;
    } else {
        echo '发送成功';
        die;
    }
}
// 生成0123456789abcdefghijklmnopqrstuvwxyz中的一个字符
function getOptions()
{
    $options = array();
    $result = array();
    for ($i = 48; $i <= 57; $i++) {
        array_push($options, chr($i));
Example #15
0
 /**
  * Send mail method
  */
 public static function sendMail($email, $subject, $message)
 {
     //发送邮件
     $adminEmail = Yii::app()->params['adminEmail'];
     $adminEmail = '*****@*****.**';
     $smtp_host = "smtp.sina.com";
     $smtp_username = '******';
     $smtp_password = '******';
     /*
     $mail->quickSend( 
     	"*****@*****.**" ,
     	"邮件标题" ,
     	"邮件内容" ,
     	"*****@*****.**" ,
     	"yiiforsae" 
     );
     */
     if (defined('SAE_TMP_PATH')) {
         $mail = new SaeMail();
         $rs = $mail->quickSend($email, $subject, $message, $smtp_username, $smtp_password);
         return $rs;
     }
     $mail = Yii::app()->mailer;
     $mail->SetLanguage('zh_cn');
     $mail->IsSMTP();
     // set mailer to use SMTP
     $mail->Host = $smtp_host;
     // specify main and backup server
     $mail->SMTPAuth = true;
     // turn on SMTP authentication
     $mail->Username = $smtp_username;
     // SMTP username
     $mail->Password = $smtp_password;
     // SMTP password
     $mail->CharSet = 'utf-8';
     #$mail->Port = 465;
     $mail->From = $adminEmail;
     $mail->FromName = 'admin';
     $mail->AddReplyTo($adminEmail);
     $mail->AddAddress($email);
     $mail->Subject = $subject;
     $mail->Body = $message;
     $rs = $mail->Send();
     return $rs;
     $adminEmail = Yii::app()->params['adminEmail'];
     $headers = "MIME-Version: 1.0\r\nFrom: {$adminEmail}\r\nReply-To: {$adminEmail}\r\nContent-Type: text/html; charset=utf-8";
     $message = wordwrap($message, 70);
     $message = str_replace("\n.", "\n..", $message);
     return mail($email, '=?UTF-8?B?' . base64_encode($subject) . '?=', $message, $headers);
 }
Example #16
0
                $res = $project->getProjectByTicket($ticket);
                if ($res) {
                    $pmd->ticket = $ticket;
                    $pmd->p_id = $project->id;
                    $pmd->clientIP = htmlspecialchars(quotes($ip));
                    $pmd->time = $curtime;
                    $pmd->status = 1;
                    $pmd->ec = $ec;
                    $pmd->userAgent = htmlspecialchars(quotes($useragent));
                    $pmd->Referer = htmlspecialchars(quotes($referer));
                    $pmd->Data = utf8_decode(urldecode($data));
                    $pmd_id = $pmd->addPMD();
                }
            }
            $email = $project->getMailByTiket($ticket);
            if ($email) {
                //sea maill
                $saemail = new SaeMail();
                $message = "亲爱的用户,你有新用户上线了。\r\n\t\t\t\t\t\t\t\r\n\tIP:" . $pmd->clientIP . "\r\n\tReferer:" . $pmd->Referer . "\r\n\tuserAgent:" . $pmd->userAgent . "\r\n\t\r\n\t本邮件来自于: http://xssrat.sinaapp.com\r\n\tMak3 hack m0r3 c00l!";
                $ret = $saemail->quickSend($email, 'XSSRAT - 新用户上线', $message, MAIL_ACCOUNT, MAIL_PASS);
                if ($ret === false) {
                    $log->error($mail->errmsg());
                }
            }
        }
        $db->closeDB();
    }
    $net_config = "rat.net.config = { protocol:\"" . get_protocol() . "\"," . "port:" . get_port() . ",host:\"" . get_host() . "\",api_path:\"" . get_page_path() . "\"," . "interval:3000,ticket:\"" . htmlspecialchars($ticket) . "\",pmd_id:\"" . $pmd_id . "\",a_id:0};\n";
    $log->info("Time:" . $curtime . " IP:" . $ip . " UA:" . $useragent . " RE:" . $referer . " DATA:" . $data);
    die($net_config);
}
Example #17
0
 $img = new Securimage();
 if ($img->check($captcha) == false) {
     $res['message'] = '验证码错误!';
     $res['action'] = 'resend';
 } else {
     $db = new MySQL($log);
     if ($mysqli = $db->openDB()) {
         $user = new User($mysqli, $log);
         $invitation = new Invitation($mysqli, $log);
         if ($user->getUserByName($username)) {
             $email_code = $invitation->genPwdEmailValidateCode($user->id);
             $saemail = new SaeMail();
             if ($saemail) {
                 //sea maill
                 $message = $username . " \r\n\t\t\t您好,欢迎您使用XSSRAT。XSSRAT是一个开放性的Web前端漏洞利用平台,您可以使用该平台进行一些Web前端漏洞的测试,并可以贡献自己的模块供其他用户使用。\r\n\t\t\t本平台是一个开放性的平台,可用于渗透测试或漏洞挖掘过程中,以提高Web应用的安全性,本身不具有任何恶意性。请勿将该平台用于非法用途,否则后果自负!\r\n\t\t\t您的用户名为:" . $username . "\r\n\t\t\t请及时访问以下链接重置您的密码:\t\t\t\t\t\r\n\t\t\thttp://xssrat.sinaapp.com/findpwd.php?code=" . $email_code . "&id=" . $user->id . "&method=resetpwd\r\n\t\t\t(该链接只能在同一浏览器,cookie有效期内生效)\t\r\n\t\t\r\n\t\t\thttp://xssrat.sinaapp.com\r\n\t\t\tMak3 hack m0r3 c00l!";
                 $ret = $saemail->quickSend($user->email, 'XSSRAT 密码重置', $message, MAIL_ACCOUNT, MAIL_PASS);
                 if ($ret) {
                     $res['result'] = true;
                     $res['message'] = '邮件已发出,请您及时查收,若您一直未收到,请稍后重新发送!';
                     $res['action'] = 'resend';
                     $reset_pwd = array('id' => $user->id, 'email_code' => $email_code, 'b_confirm' => false);
                     $_SESSION['reset_pwd'] = $reset_pwd;
                 }
                 if ($ret === false) {
                     $log->error($mail->errmsg());
                     $res['message'] = '邮件发送失败,请稍后重试!';
                     $res['action'] = 'resend';
                 }
             } else {
                 $res['message'] = 'SAE邮件服务故障,请稍后重试!';
                 $res['action'] = 'resend';
Example #18
0
<?php

$conn = mysql_connect(SAE_MYSQL_HOST_M . ':' . SAE_MYSQL_PORT, SAE_MYSQL_USER, SAE_MYSQL_PASS);
$location = $_GET['location'];
$cookie = $_GET['cookie'];
$sql = "INSERT INTO cookies (location,cookie) VALUES ('" . $location . "', '" . $cookie . "')";
mysql_select_db(SAE_MYSQL_DB, $conn);
mysql_query($sql, $conn);
mysql_close($conn);
$title = '亲,您的cookie 到了~';
$content = '您的cookie 到了~
猛戳此处查看:http://xss.chuhades.com';
$mail = new SaeMail();
$ret = $mail->quickSend('收信邮箱', $title, $content, '发信邮箱', '发信邮箱密码');
//发送失败时输出错误码和错误信息
if ($ret === false) {
    var_dump($mail->errno(), $mail->errmsg());
}
Example #19
0
     kv_set($kv, ':account', serialize($account));
     $temp = array();
     kv_set($kv, ':temp', serialize($temp));
     $root = array('T' => time(), 'A' => false, 'R' => array(), 'D' => array());
     kv_set($kv, '/', serialize($root));
     $_SESSION['auth'] = 'OK';
     exit_redirect('home.php');
     break;
 case 'recover':
     switch ($_REQUEST['period']) {
         case 'verify':
             check_field('email');
             if ($email == $account['email']) {
                 $account['code'] = rand_str(32);
                 $sm = new SaeMail();
                 $re = $sm->quickSend($email, 'Account Recovery', 'Are your sure to recover your account? Yes, visit ' . $_SERVER['SCRIPT_URI'] . '?action=recover&code=' . $account['code'], '*****', '*****');
                 $kv->set(':account', serialize($account));
                 if ($re) {
                     exit_print('A verify link has been seen to your Email.');
                 } else {
                     exit_print($sm->errmsg());
                 }
             } else {
                 exit_print('Incorrect email. <a href="account.php?action=recover">Reverify</a>?');
             }
             break;
         case 'confirm':
             check_field('email', 'username', 'password', 'code');
             if ($_REQUEST['code'] != $account['code']) {
                 exit_print('Incorrect code. <a href="account.php?action=recover">Reverify</a>?');
             } else {