hasProperty("status")){ $this->status = self::STATUS_PENDING; } if (!$this->hasProperty("priority")){ $this->priority = self::PRIORITY_NORMAL; } foreach ($requiredProps as $prop){ if (!$this->hasProperty($prop)){ throw new CoreException("Missing parameter '$prop' while calling MailModel::__construct()"); } } } public function getMailObject(){ $email = new PHPMailer(); $email->CharSet = "UTF-8"; $email->isMail(); $email->From = $this->from; if ($this->hasProperty("fromName")){ $email->FromName = $this->fromName; } $email->Subject = $this->subject; $email->IsHTML(true); $email->Body = $this->body; if ($this->hasProperty("altBody")){ $email->AltBody = $this->altBody; } else { $email->AltBody = strip_tags($this->body); } $email->AddAddress($this->recipient); if ($this->hasProperty("attachment")){ $email->AddAttachment( $this->attachment , basename($this->attachment) ); } return $email; } public static function getCollectionName(){ return "mail"; } } ?>