smtp = new SMTP($logger); $this->message = new Message(); } /** * set server and port * @param string $host server * @param int $port port * @param string $secure ssl tls * @return $this */ public function setServer($host, $port, $secure=null){ $this->smtp->setServer($host, $port, $secure); return $this; } /** * auth with server * @param string $username * @param string $password * @return $this */ public function setAuth($username, $password){ $this->smtp->setAuth($username, $password); return $this; } /** * set mail from * @param string $name * @param string $email * @return $this */ public function setFrom($name, $email){ $this->message->setFrom($name, $email); return $this; } /** * set fake mail from * @param string $name * @param string $email * @return $this */ public function setFakeFrom($name, $email){ $this->message->setFakeFrom($name, $email); return $this; } /** * set mail receiver * @param string $name * @param string $email * @return $this */ public function setTo($name, $email){ $this->message->addTo($name, $email); return $this; } /** * add mail receiver * @param string $name * @param string $email * @return $this */ public function addTo($name, $email){ $this->message->addTo($name, $email); return $this; } /** * set mail subject * @param string $subject * @return $this */ public function setSubject($subject){ $this->message->setSubject($subject); return $this; } /** * set mail body * @param string $body * @return $this */ public function setBody($body){ $this->message->setBody($body); return $this; } /** * set mail attachment * @param $name * @param $path * @return $this * @internal param string $attachment */ public function setAttachment($name, $path){ $this->message->addAttachment($name, $path); return $this; } /** * add mail attachment * @param $name * @param $path * @return $this * @internal param string $attachment */ public function addAttachment($name, $path){ $this->message->addAttachment($name, $path); return $this; } /** * Send the message... * @return boolean */ public function send(){ return $this->smtp->send($this->message); } }