Ejemplo n.º 1
0
		public function Send($template_name = null, $mail_args = null, $email = null, $name = null)
		{
			if ($template_name && is_array($mail_args) && $email)
			{
				if (class_exists("Log", false))
					Log::Log("Sending email '{$template_name}' to '{$email}'", E_USER_NOTICE);
				
				$this->ClearAddresses();
				$this->SmartyBody = array($template_name, $mail_args);
				$this->AddAddress($email, $name);
				$this->Observable->Fire('BeforeSend', $this);
			}
				
			if (!parent::Send() && class_exists("Log", false))
				Log::Log("Cannot send email:".$this->ErrorInfo, E_ERROR);
				
			$this->ClearAddresses();
		}