SlightPHP\PHPMailer::Send PHP Метод

Send() публичный Метод

Creates message and assigns Mailer. If the message is not sent successfully then it returns false. Use the ErrorInfo variable to view description of the error.
public Send ( ) : boolean
Результат boolean
    public function Send()
    {
        $header = '';
        $body = '';
        $result = true;
        if (count($this->to) + count($this->cc) + count($this->bcc) < 1) {
            $this->SetError($this->Lang('provide_address'));
            return false;
        }
        /* Set whether the message is multipart/alternative */
        if (!empty($this->AltBody)) {
            $this->ContentType = 'multipart/alternative';
        }
        $this->error_count = 0;
        // reset errors
        $this->SetMessageType();
        $header .= $this->CreateHeader();
        $body = $this->CreateBody();
        if ($body == '') {
            return false;
        }
        /* Choose the mailer */
        switch ($this->Mailer) {
            case 'sendmail':
                $result = $this->SendmailSend($header, $body);
                break;
            case 'smtp':
                $result = $this->SmtpSend($header, $body);
                break;
            case 'mail':
                $result = $this->MailSend($header, $body);
                break;
            default:
                $result = $this->MailSend($header, $body);
                break;
                //$this->SetError($this->Mailer . $this->Lang('mailer_not_supported'));
                //$result = false;
                //break;
        }
        return $result;
    }