Send a new mailable message instance.

@param  \Illuminate\Contracts\Mail\Mailable  $mailable

@return mixed
161674
public function send(MailableContract $mailable)
    {
        if ($mailable instanceof ShouldQueue) {
            return $this->queue($mailable);
        }

        return $this->mailer->send($this->fill($mailable));
    }
168563
public function message($to = '', $subject = '', $body = '')
    {
        $message = $this->transport->newMessage();

        if ($to) {
            $message->to($to);
        }
        if ($subject) {
            $message->subject($subject);
        }
        if ($body) {
            $message->body($body);
        }

        $message->setMailer($this);

        return $message;
    }
353800
public static function fromException(\Throwable $exception): self
    {
        return new self(
            $exception->getMessage(),
            $exception->getCode(),
            $exception
        );
    }
299092
public function send()
    {
        if (!$this->mailSender) {
            throw new \Parable\Mail\Exception('No mail sender implementation set.');
        }

        // Check the basics
        if (count($this->addresses['to']) === 0) {
            throw new \Parable\Mail\Exception('No to addresses provided.');
        }
        if (empty($this->subject)) {
            throw new \Parable\Mail\Exception('No subject provided.');
        }
        if (empty($this->body)) {
            throw new \Parable\Mail\Exception('No body provided.');
        }

        // Handle the to, cc and bcc addresses
        $to  = $this->getAddressesForType('to');
        $cc  = $this->getAddressesForType('cc');
        $bcc = $this->getAddressesForType('bcc');

        if (!empty($cc)) {
            $this->addHeader("Cc: {$cc}");
        }
        if (!empty($bcc)) {
            $this->addHeader("Bcc: {$bcc}");
        }

        // Handle from
        $from = $this->getAddressesForType('from');
        $this->addHeader("From: {$from}");

        $headers = array_merge($this->requiredHeaders, $this->headers);
        $headers = implode("\r\n", $headers);

        return $this->getMailSender()->send($to, $this->subject, $this->body, $headers);
    }
418534
private function createResponseObject(callable $callable)
    {
        try {
            $response = new JsonResponse($callable());
        } catch (EntityNotFoundException $notFoundException) {
            $response = new JsonResponse(
                $notFoundException->getMessage(),
                404
            );
        } catch (Exception $e) {
            $response = new JsonResponse(
                'API exception. Please contact your webmaster',
                500
            );
        }

        return $response;
    }
158881
public function later($delay, Mailable $mailable)
    {
        return $this->mailer->later($delay, $this->fill($mailable));
    }
1090860
protected function fill(Mailable $mailable): Mailable
    {
        return $mailable->to($this->to)
                        ->cc($this->cc)
                        ->bcc($this->bcc)
                        ->locale($this->locale);
    }
435000
public function send()
    {
        foreach ($this->messages as $mail) {
            $this->mailer->send($mail);
        }
        return $this;
    }
1346310
public function withReadable(bool $readable): self
    {
        $metadata = clone $this;
        $metadata->readable = $readable;

        return $metadata;
    }
725379
private function setPostalArea(string $postalArea): AddressEmbeddableInterface
    {
        $this->notifyEmbeddablePrefixedProperties(
            'postalArea',
            $this->postalArea,
            $postalArea
        );
        $this->postalArea = $postalArea;

        return $this;
    }
306421
public function send($message)
    {
        if (!$message instanceof MailMessage) {
            throw new \InvalidArgumentException(
                sprintf('Mailer::%s expect instance of Swift_Message.', __FUNCTION__)
            );
        }

        return $this->swift->send($message, $this->failedRecipients);
    }
844836
public function sendMessage()
    {
        try {
            // First: Send message with given transport
            $this->_transport->sendMessage();

            // Second: Create a mail instance to store
            $mail = $this->getMail();
            $mail->updateWithTransport($this->_transport);
            $mail->save();

        } catch (\Exception $e) {
            throw new MailException(
                new Phrase($e->getMessage()),
                $e
            );
        }

        return $this;
    }
853228
public function add($cacheId, Cacheable $cacheable)
    {
        $this->cachedItems[$cacheId] = (object) [
            'cacheable' => $cacheable,
            'expiry' => $this->timeUtil->expiry($cacheable->ttl())
        ];
        return $this;
    }
1322772
private function handleThrowtable(\Throwable $throwable)
    {
        $message = sprintf("%s %s %d", $throwable->getFile(), $throwable->getMessage(), $throwable->getLine());

        /* @var \Swoft\Http\Message\Server\Response $response */
        $response = RequestContext::getResponse();
        $response = $response->json([$message]);

        return $response;
    }
1329678
public function send(MailMessage $message)
    {
        $msg = \Swift_Message::newInstance();

        $type = $message->getHtml() ? 'text/html' : null;

        $msg->setSubject($message->getSubject())
            ->setTo($message->getTo())
            ->setFrom($message->getFrom())
            ->setCc($message->getCc())
            ->setBcc($message->getBcc())
            ->setReplyTo($message->getReplyTo())
            ->setBody($message->getBody(), $type, 'utf8');

        $files = $message->getFiles();

        foreach ($files as $file) {
            $attach = \Swift_Attachment::newInstance();

            if ($file->getFilename()) {
                $attach->setFilename($file->getFilename());
            }

            if ($file->getContentType()) {
                $attach->setContentType($file->getContentType());
            }

            $attach->setBody($file->getBody());

            $msg->attach($attach);
        }

        return $this->getMailer()->send($msg);
    }
389983
public function withEmail($email)
    {
        $request = clone $this;
        $request->email = $email instanceof Email ? $email : new Email($email);

        return $request;
    }
479804
public function send(Sendable $model, AbstractEnvelope $envelope)
    {
        $classname = $this->getType($model);

        if (intval($model->getId()) == 0) {
            $model->save($this->getService($classname));
        }

        $response = $this->request(
            $this->buildUrl($model, null, '/send_' . strtolower($classname)), 'PUT', $this->mapper->mapToStorage($envelope)
        );

        return $this->mapper->mapFromStorage($response);
    }