src/Leevel/Mail/Mail.php
public function send(Closure $callbacks = null, bool $htmlPriority = true): int
    {
        $this->makeMessage();

        $this->parseMailContent($htmlPriority);

        if ($callbacks) {
            $this->message($callbacks);
        }

        if (!empty($this->option['global_to']['address'])) {
            $this->message->addTo(
                $this->option['global_to']['address'],
                $this->option['global_to']['name']
            );
        }

        $this->handleDispatch($this->message);

        return $this->sendMessage($this->message);
    }
public function send(Closure $callbacks = null, bool $htmlPriority = true): int
    {
        $this->makeMessage();

        $this->parseMailContent($htmlPriority);

        if ($callbacks) {
            $this->message($callbacks);
        }

        if (!empty($this->option['global_to']['address'])) {
            $this->message->addTo(
                $this->option['global_to']['address'],
                $this->option['global_to']['name']
            );
        }

        $this->handleDispatch($this->message);

        return $this->sendMessage($this->message);
    }
发送邮件.

@param \Closure $callbacks
@param bool     $htmlPriority

@return int