Helper\Mailer::send PHP Method

send() public method

public send ( Mail $mail )
$mail Model\Mail
    public function send(Mail $mail)
    {
        if (self::$available) {
            if ($this->queued) {
                // 如果是发送到列队,则将邮件插入到邮件列队表
                $mail->save();
                return true;
            } else {
                $ul = ucfirst(self::$available);
                $class = "\\Helper\\Mailer\\{$ul}";
                $mailer = new $class();
                $result = $mailer->send($mail);
                if ($result) {
                    return true;
                }
                return false;
            }
        } else {
            throw new Error("Mail Exception: CLASS " . self::$available . " not available");
        }
        return false;
    }