| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 | 
							- <?php 
 
- /**
 
-  * 邮件发送,普通发送
 
-  */
 
- require_once( ONU_ROOT . 'application/module/ctrl/Action.class.php');
 
- require_once ( ONU_ROOT . 'application/lib/data/adminAction.php');
 
- class Send_email1_adminAction extends Action{
 
- 	
 
- 	public function __construct(){
 
- 		parent::__construct();
 
- 		if(empty($_SESSION['mds_user'])){
 
- 			header("Location:/?a=index&m=admin_login");
 
- 			exit();
 
- 		}
 
- 	}
 
- 	public function index(){
 
- 		$admin = new AdvertAdminAction();
 
- 		$api_user = $_SESSION['API_USER'];
 
- 		$api_key  = $_SESSION['API_KEY'];
 
- 		$from     = $_SESSION['FROM'];
 
- 		$uid      = $_SESSION['user_infos']['id'];
 
- 		$info     = $_REQUEST['info'];
 
- 		$post_url = 'http://api.sendcloud.net/apiv2/mail/send';
 
- 		if($_POST){
 
- 			if(!empty($_POST['email_title']) && !empty($_POST['email_content'])){
 
- 				$subject = $_POST['email_title'];
 
- 				$content =  $_POST['email_content'];
 
- 				$content = str_replace("\n","<br/>",$content);
 
- 				$replyto = $_SESSION['user_infos']['email'];//发件人邮箱地址
 
- 				$to = '';//收件人地址
 
- 				$customer_list = $admin->selesctCustomer("where uid='$uid'");
 
- 				foreach($customer_list as $list){
 
- 					$to .= $list['email'].';';
 
- 				}
 
- 				$to = trim($to,';');
 
- 				$params = array(
 
- 					'apiUser' => $api_user,
 
- 					'apiKey'  => $api_key,
 
- 					'to'        => $to,
 
- 					'from'     => $from,
 
- 					'subject' => $subject,
 
- 					'html'    =>  $content,
 
- 					'replyto' => $replyto
 
- 				);
 
- 				$result = make_curl($post_url,$params);
 
- 				//插入 普通邮件发送日志表
 
- 				$params['uid'] = $uid;
 
- 				$params['message'] = $result['message'];
 
- 				$params['time'] = time();
 
- 				$insert_log = $admin->inserEmail1Log($params);
 
- 				$info = $result['message'];
 
- 				header("Location:/?a=send_email1_admin&m=index&info=$info");
 
- 				exit();
 
- 			}else{
 
- 				$info = "邮件标题、邮件内容为必填项,请填写完整!";
 
- 			}
 
- 		}
 
- 		$this->assign('info',$info);
 
- 		$this->display("index.html");
 
- 	}
 
- 	// class   end
 
- }
 
- ?>
 
 
  |