public function send(Message $message)
    {
        $mailer = $this->getMailer();
        $mailer->SetFrom($this->getFrom($message));
        $mailer->AddReplyTo($this->getFrom($message));
        $mailer->Subject = $message->getTitle();
        $mailer->AltBody = strip_tags(preg_replace("/<br.*>/i", "\n", $message->getBody()));
        $mailer->MsgHTML($message->getBody());
        $mailer->AddAddress($this->getUserMail($message->getTo()));

        $result = false;
        try {
            if ($mailer->Send()) {
                $message->setStatus(\oat\tao\model\messaging\Message::STATUS_SENT);
                $result = true;
            }
            if ($mailer->IsError()) {
                $message->setStatus(\oat\tao\model\messaging\Message::STATUS_ERROR);
            }
        } catch (phpmailerException $pe) {
            \common_Logger::e($pe->getMessage());
        }
        $mailer->ClearReplyTos();
        $mailer->ClearAllRecipients();
        $mailer->SmtpClose();

        return $result;
    }
public function send(Message $message)
    {
        $mailer = $this->getMailer();
        $mailer->SetFrom($this->getFrom($message));
        $mailer->AddReplyTo($this->getFrom($message));
        $mailer->Subject = $message->getTitle();
        $mailer->AltBody = strip_tags(preg_replace("/<br.*>/i", "\n", $message->getBody()));
        $mailer->MsgHTML($message->getBody());
        $mailer->AddAddress($this->getUserMail($message->getTo()));

        $result = false;
        try {
            if ($mailer->Send()) {
                $message->setStatus(\oat\tao\model\messaging\Message::STATUS_SENT);
                $result = true;
            }
            if ($mailer->IsError()) {
                $message->setStatus(\oat\tao\model\messaging\Message::STATUS_ERROR);
            }
        } catch (phpmailerException $pe) {
            \common_Logger::e($pe->getMessage());
        }
        $mailer->ClearReplyTos();
        $mailer->ClearAllRecipients();
        $mailer->SmtpClose();

        return $result;
    }
public function send ( Message $ message ) { $ mailer = $ this -> getMailer ( ) ; $ mailer -> SetFrom ( $ this -> getFrom ( $ message ) ) ; $ mailer -> AddReplyTo ( $ this -> getFrom ( $ message ) ) ; $ mailer -> Subject = $ message -> getTitle ( ) ; $ mailer -> AltBody = strip_tags ( preg_replace ( "/<br.*>/i" , "\n" , $ message -> getBody ( ) ) ) ; $ mailer -> MsgHTML ( $ message -> getBody ( ) ) ; $ mailer -> AddAddress ( $ this -> getUserMail ( $ message -> getTo ( ) ) ) ; $ result = false ; try { if ( $ mailer -> Send ( ) ) { $ message -> setStatus ( \ oat \ tao \ model \ messaging \ Message :: STATUS_SENT ) ; $ result = true ; } if ( $ mailer -> IsError ( ) ) { $ message -> setStatus ( \ oat \ tao \ model \ messaging \ Message :: STATUS_ERROR ) ; } } catch ( phpmailerException $ pe ) { \ common_Logger :: e ( $ pe -> getMessage ( ) ) ; } $ mailer -> ClearReplyTos ( ) ; $ mailer -> ClearAllRecipients ( ) ; $ mailer -> SmtpClose ( ) ; return $ result ; }
Sent email message

@access public
@author Bertrand Chevrier, <bertrand.chevrier@tudor.lu>
@param Message $message
@return boolean whether message was sent
Sent email message