<?php
class EmailAction extends Action {
	public $Mailer;
	public function _initialize(){
		import("@.iGuoji.Phpmailer");
		$this->Mailer = new PHPMailer();
		$this->Mailer->IsSMTP();
		$this->Mailer->Host = 'smtp.exmail.qq.com';
		$this->Mailer->Port = 25;
		$this->Mailer->SMTPAuth = true;
		$this->Mailer->Username = 'user@yeyou.tw';
		$this->Mailer->Password = '123.yeyou.tw';
		$this->Mailer->From = 'user@yeyou.tw';
		$this->Mailer->WordWrap = 30;
		$this->Mailer->IsHTML(true);
		$this->Mailer->CharSet = "UTF-8";
		$this->Mailer->Encoding = "base64";
	}
	// 找回密码
	public function getmi($name,$email,$pass){
		// 保存资料
		$this->assign("name",$name);
		$this->assign("pass",$pass);
		$this->assign("title",TITLE);
		$this->assign("site",DOMAIN);
		// 邮件信息
		$this->Mailer->FromName = TITLE;
		$this->Mailer->AddAddress($email,$name);
		$this->Mailer->Subject = TITLE." : $name 找回密码!";
		$this->Mailer->Body = $this->fetch("Email:getmi");
		$rel = $this->Mailer->Send();
		if(!$rel) return $this->Mailer->ErrorInfo;
		return true;
	}
}
?>