src/Ease/Mailer.php
public function send()
    {
        if (!$this->finalized) {
            $this->finalize();
        }

        $oMail = new \Mail();
        if (count($this->parameters)) {
            $this->mailer = $oMail->factory('smtp', $this->parameters);
        } else {
            $this->mailer = $oMail->factory('mail');
        }
        $this->sendResult = $this->mailer->send($this->emailAddress,
            $this->mailHeadersDone, $this->mailBody);

        if ($this->notify === true) {
            $mailStripped = str_replace(['<','>'], '', $this->emailAddress);
            if ($this->sendResult === true) {
                $this->addStatusMessage(sprintf(_('Message %s was sent to %s'),
                        $this->emailSubject, $mailStripped), 'success');
            } else {
                $this->addStatusMessage(sprintf(_('Message %s, for %s was not sent because of %s'),
                        $this->emailSubject, $mailStripped,
                        $this->sendResult->message), 'warning');
            }
        }

        return $this->sendResult;
    }
public function send()
    {
        if (!$this->finalized) {
            $this->finalize();
        }

        $oMail = new \Mail();
        if (count($this->parameters)) {
            $this->mailer = $oMail->factory('smtp', $this->parameters);
        } else {
            $this->mailer = $oMail->factory('mail');
        }
        $this->sendResult = $this->mailer->send($this->emailAddress,
            $this->mailHeadersDone, $this->mailBody);

        if ($this->notify === true) {
            $mailStripped = str_replace(['<','>'], '', $this->emailAddress);
            if ($this->sendResult === true) {
                $this->addStatusMessage(sprintf(_('Message %s was sent to %s'),
                        $this->emailSubject, $mailStripped), 'success');
            } else {
                $this->addStatusMessage(sprintf(_('Message %s, for %s was not sent because of %s'),
                        $this->emailSubject, $mailStripped,
                        $this->sendResult->message), 'warning');
            }
        }

        return $this->sendResult;
    }
Send mail.