Naux\Mail\SendCloudTransport::send PHP Method

send() public method

Recipient/sender data will be retrieved from the Message API. The return value is the number of recipients who were accepted for delivery.
public send ( Swift_Mime_Message $message, string[] &$failedRecipients = null ) : integer
$message Swift_Mime_Message
$failedRecipients string[] An array of failures by-reference
return integer
    public function send(Swift_Mime_Message $message, &$failedRecipients = null)
    {
        $this->addQuery('subject', $message->getSubject());
        $this->addQuery('from', $this->getAddress($message->getFrom()));
        $this->addQuery('fromname', $this->getFromName($message));
        $this->addQuery('replyto', $this->getAddress($message->getReplyTo()));
        $this->addQuery('cc', $this->getAddresses($message->getCc()));
        $this->addQuery('bcc', $this->getAddresses($message->getBCc()));
        // 附件
        if (!empty($message->getChildren())) {
            foreach ($message->getChildren() as $file) {
                $this->addQuery('files[]', $file->getBody(), $file->getFilename());
            }
        }
        $this->query = array_filter($this->query);
        $body = $message->getBody();
        if ($body instanceof SendCloudTemplate) {
            $this->sendTemplate($message);
        } else {
            $this->sendRawMessage($message);
        }
    }