Sends the message.

@return int the number of recipients who were accepted for delivery
552569
public function send(): int
    {
        $this->sent = true;
        $this->failedRecipients = [];
        return $this->mailer->send($this, $this->failedRecipients);
    }
786144
public function sendChatActionReply(): SendChatAction
	{
		$m = $this->bot->sendChatAction();
		$this->setReplyMarkup($m, false);
		return $m;
	}
350256
public function send()
    {
        $mimeMessage = $this->createMimeMessage();
        $this->message = $mimeMessage;
        $this->preparingSend();
        imap_mail(
            $this->properties->to,
            $this->properties->subject,
            $this->properties->message,
            $this->properties->additional_headers,
            $this->properties->cc,
            $this->properties->bcc,
            $this->properties->rpath
        );
    }
138716
public function send()
    {
        $aReminder = $this->json();
        $aReminder = json_decode($aReminder, true);

        $aReminder['sales_invoice_ids'] = array_map(function ($salesInvoice) {
            if (is_object($salesInvoice)) {
                return $salesInvoice->id;
            } else {
                return $salesInvoice;
            }
        }, $this->sales_invoices);
        unset($aReminder['sales_invoices']);

        $this->connection->post($this->endpoint . '/send_reminders', json_encode([
            'sales_invoice_reminders' => [$aReminder],
        ]));
    }
12709
public function send()
    {
        $allowed_status_codes = array_merge(array(200), $this->ignoredStatusCodes);
        $this->ignoredStatusCodes = array();

        try {
            $this->_setupCurl();
            $response = curl_exec($this->curl);

            if (!in_array(curl_getinfo($this->curl, CURLINFO_HTTP_CODE), $allowed_status_codes)) {
                if (curl_errno($this->curl)) {
                    throw new \RuntimeException('The HTTP request failed: ' . curl_error($this->curl));
                }
                throw new \RuntimeException('The HTTP request failed: unknown error.');
            }
            curl_close($this->curl);

            return $this->hasToDecodeResponse ? json_decode($response) : $response;
        } catch (Exception $e) {  }
    }
701979
protected function _send()
	{
		// Build the message
		$message = $this->build_message();

		// Open a connection
		$return_path = ($this->config['return_path'] !== false) ? $this->config['return_path'] : $this->config['from']['email'];
		$handle = @popen($this->config['sendmail_path'] . " -oi -f ".$return_path." -t", 'w');

		// No connection?
		if(! is_resource($handle))
		{
			throw new \SendmailConnectionException('Could not open a sendmail connection at: '.$this->config['sendmail_path']);
		}

		// Send the headers
		fputs($handle, $message['header']);

		// Send the body
		fputs($handle, $message['body']);

		if(pclose($handle) === -1)
		{
			throw new \SendmailFailedException('Failed sending email through sendmail.');
		}

		return true;
	}
1092599
public function sendNextMessage()
    {
        if (count($this->outQueue) > 0) {
            $msgnode = array_shift($this->outQueue);
            $msgnode->refreshTimes();
            $this->lastId = $msgnode->getAttribute('id');
            $this->sendNode($msgnode);
        } else {
            $this->lastId = false;
        }
    }
1297343
public function send()
    {
        $response = $this->sendApiCall(self::ACTION_CREATE, $this->getCreateUrl());

        if (!isset($response->getBody()['_embedded']['items'])) {
            throw new Exception('Invalid response returned from server', Exception::INVALID_RESPONSE);
        }

        $result = array();
        foreach ($response->getBody()['_embedded']['items'] as $item) {
            $result[] = $sms = new NumberLookup($this->client, $this->factory);
            $sms->setFields($item);
        }

        return $result;
    }
424768
public function send()
    {
        // Send headers
        if (headers_sent() === false) {
            if (strpos(PHP_SAPI, 'cgi') === 0) {
                header(sprintf('Status: %s', $this->getReasonPhrase()));
            } else {
                header(sprintf('%s %s', $this->getProtocolVersion(), $this->getReasonPhrase()));
            }

            foreach ($this->headers as $name => $value) {
                foreach ($value as $hVal) {
                    header("$name: $hVal", false);
                }
            }
        }

        // Send body
        $this->body->seek(0);
        while ($this->body->feof() === false) {
            echo $this->body->read(1024);
        }

        return $this;
    }
49732
public function send(): bool
    {
        if (!$this->receiver) {
            throw new SmsSendException('Missing SMS receiver!');
        }
        if (!$this->sms) {
            throw new SmsSendException('Missing SMS!');
        }

        $this->send_results = [];

        $send_result = false;

        array_unshift($this->spare_agents, $this->default_agent);
        $agents = array_unique($this->spare_agents);
        if (empty($agents)) {
            throw new SmsSendException('No agent available!');
        }

        foreach ($agents as $agent_name) {
            $agent = SmsAgent::getAgent($agent_name);
            $result = $agent->send($this->receiver, $this->sms, $this->sms_params);
            $this->send_results[$agent_name] = $agent->getResult();
            if ($result) {
                $send_result = true;
                break;
            }
        }

        $this->reset();

        return $send_result;
    }
513098
public function send()
    {
        if (empty($this->firstDueDate)) {
            self::setFirstDueDate(\Carbon\Carbon::now()->addDays(3));
        }

        if (empty($this->numberOfPayments)) {
            self::setNumberOfPayments(1);
        }

        $this->validatePaymentSettings();

        $config = [
            'reference'         => $this->reference,
            'amount'            => $this->amount,
            'notificationURL'   => $this->notificationURL,
            'description'       => $this->description,
            'instructions'      => $this->instructions,
            'periodicity'       => 'monthly',
            'numberOfPayments'  => $this->numberOfPayments,
            'firstDueDate'      => $this->firstDueDate,
        ];

        $custumerArray = array_merge($this->custumer['customer'], ['address' => $this->custumer['address']]);

        $data = array_filter(array_merge($config, ['customer' => $custumerArray]));

        return $this->sendJsonTransaction($data, $this->url['boletos'], 'POST', ['Accept: application/json;charset=ISO-8859-1', 'Content-type: application/json;charset=ISO-8859-1']);
    }
192745
public function send()
    {
        $message = $this->message ?: ($this->task ? ucwords($this->getSystemUser()).' ran the ['.$this->task.'] task.' : ucwords($this->getSystemUser()).' ran a task.');

        $payload = array_merge(['text' => $message, 'channel' => $this->channel], $this->options);

        Request::post("{$this->hook}")->sendsJson()->body($payload)->send();
    }
63806
public function send()
    {
        $result = $this->mailer->send();

        if ( NULL !== $this->dispatcher )
        {
            $event = new SendMailEvent( $this->to, $this->getSubject(), $this->getBody(), $result );

            $this->dispatcher->fire( Events::EVENT_SEND_MESSAGE, $event );
        }

        return $result;
    }
762966
public function count()
    {
        $request = $this->createRequestInstance(self::CAT_COUNT, null, null);

        return $this->client->send($request);
    }
749251
public function send() {
        $content = '';

        foreach ($this->_message as $message) {
            $content .= $message;
        }

        foreach ($this->_receiver as $receiver) {
            $this->_backline = $this->_setBackLine($receiver);

            //Create the header
            $header = "From: \"" . $this->_sender[0] . "\" <" . $this->_sender[1] . ">" . $this->_backline;
            $header .= "Reply-to: \"" . $this->_reply[0] . "\" <" . $this->_reply[1] . ">" . $this->_backline;
            $header .= "MIME-Version: 1.0" . $this->_backline;

            foreach ($this->_cc as $cc) {
                $header .= "Cc: " . $cc . "" . $this->_backline;
            }

            foreach ($this->_bcc as $bcc) {
                $header .= "Bcc: " . $bcc . "" . $this->_backline;
            }

            foreach ($this->_reception as $reception) {
                $header .= "DispositionNotificationTo: " . $reception . "" . $this->_backline;
            }

            $header .= "Content-Type: " . $this->_fileTransfert . ";" . $this->_backline . " boundary=\"" . $this->_boundary . "\"" . $this->_backline;

            //Create the message
            $message = $this->_backline . "--" . $this->_boundary . $this->_backline;
            $message .= "Content-Type: multipart/alternative;" . $this->_backline . " boundary=\"" . $this->_boundaryAlt . "\"" . $this->_backline;
            $message .= $this->_backline . "--" . $this->_boundaryAlt . $this->_backline;

            if ($this->_formatHtml == self::FORMAT_HTML) {
                $message .= "Content-Type: text/html; charset=\"" . $this->_charset . "\"" . $this->_backline;
                $message .= "Content-Transfer-Encoding: 8bit" . $this->_backline;
                $message .= $this->_backline . $content . $this->_backline;
            }
            elseif ($this->_formatHtml == self::FORMAT_TEXT) {
                $message .= "Content-Type: text/plain; charset=\"" . $this->_charset . "\"" . $this->_backline;
                $message .= "Content-Transfer-Encoding: 8bit" . $this->_backline;
                $message .= $this->_backline . $content . $this->_backline;
            }

            //We close the boundaries
            $message .= $this->_backline . "--" . $this->_boundaryAlt . "--" . $this->_backline;

            foreach ($this->_attachments as $key => $value) {
                $message .= $this->_backline . "--" . $this->_boundary . $this->_backline;
                $message .= "Content-Type: " . $value[1] . "; name=\"" . $key . "\"" . $this->_backline;
                $message .= "Content-Transfer-Encoding: base64" . $this->_backline;
                $message .= "Content-Disposition: attachment; filename=\"" . $key . "\"" . $this->_backline;
                $message .= $this->_backline . $value[0] . $this->_backline . $this->_backline;
            }

            $message .= $this->_backline . "--" . $this->_boundary . "--" . $this->_backline;

            if (Config::config()['user']['mail']['enabled']) {
                mail($receiver, $this->_subject, $message, $header);
            }
        }
    }
1126079
public function send()
    {
        // Check if headers are sent already.
        if (headers_sent() === false) {

            // Determine reason phrase
            if ($this->reasonPhrase === null) {
                $this->reasonPhrase = self::$messages[$this->statusCode];
            }

            // Send status code.
            header(sprintf('%s %s', $this->protocolVersion, $this->reasonPhrase), true, $this->statusCode);

            // Send headers.
            foreach ($this->headers as $header => $value) {
                header(sprintf('%s: %s', $header, $value), true, $this->statusCode);
            }

            // Send cookies.
            foreach ($this->cookies as $cookie) {
                setcookie($cookie['name'], $cookie['value'], $cookie['expire'],
                    $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httponly']);
            }

            // Send body.
            echo $this->body;
        }

        return $this;
    }
1277256
public function send()
    {
        $to = $this->getToForSend();
        $headers = $this->getHeadersForSend();

        if (empty($to)) {
            throw new \RuntimeException(
                'Unable to send, no To address has been set.'
            );
        }

        if ($this->hasAttachments()) {
            $message  = $this->assembleAttachmentBody();
            $headers .= PHP_EOL . $this->assembleAttachmentHeaders();
        } else {
            $message = $this->getWrapMessage();
        }

        return mail($to, $this->_subject, $message, $headers, $this->_params);
    }