Send all messages

@return \pwf\components\swiftmailer\SwiftMailer
435000
public function send()
    {
        foreach ($this->messages as $mail) {
            $this->mailer->send($mail);
        }
        return $this;
    }
574156
public function send($transporter='', $options=array())
	{
		$transporter = $transporter ? $transporter : \Config::get('mailer');

		if (is_object($transporter) && ($transporter instanceof \Swift_Transport))
		{
			// We were given a valid tranport mechanisms, so just use it
			$transport = $transporter;
		}
		elseif (is_string($transporter) && self::hasTrasporter($transporter))
		{
			$transport = self::getTrasporter($transporter);
		}
		else
		{
			switch (strtolower($transporter))
			{
				case 'smtp':
					if (!isset($options['host']))
					{
						$options['host'] = \Config::get('smtphost');
					}
					if (!isset($options['port']))
					{
						$options['port'] = \Config::get('smtpport');
					}
					if (!isset($options['username']))
					{
						$options['username'] = \Config::get('smtpuser');
					}
					if (!isset($options['password']))
					{
						$options['password'] = \Config::get('smtppass');
					}

					if (!empty($options))
					{
						$transport = \Swift_SmtpTransport::newInstance($options['host'], $options['port']);
						$transport->setUsername($options['username'])
						          ->setPassword($options['password']);
					}
				break;

				case 'sendmail':
					if (!isset($options['command']))
					{
						$options['command'] = '/usr/sbin/exim -bs';
					}
					$transport = \Swift_SendmailTransport::newInstance($options['command']);
				break;

				case 'mail':
				default:
					$transport = \Swift_MailTransport::newInstance();
					//set mail additional args (mail return path - used for bounces)
					//$transport->setExtraParams('-f hubmail-bounces@' . $_SERVER['HTTP_HOST']);
				break;
			}

			if (!($transport instanceof \Swift_Transport))
			{
				throw new \InvalidArgumentException('Invalid transport specified');
			}
		}

		$mailer = \Swift_Mailer::newInstance($transport);
		$result = $mailer->send($this, $this->_failures);

		if ($result)
		{
			\Log::info(sprintf('Mail sent to %s', json_encode($this->getTo())));
		}
		else
		{
			\Log::error(sprintf('Failed to mail %s', json_encode($this->getTo())));
		}

		return $result;
	}
447202
protected function _send()
	{
		$message = $this->build_message(true);

		if(empty($this->config['smtp']['host']) or empty($this->config['smtp']['port']))
		{
			throw new \FuelException('Must supply a SMTP host and port, none given.');
		}

		// Use authentication?
		$authenticate = (empty($this->smtp_connection) and ! empty($this->config['smtp']['username']) and ! empty($this->config['smtp']['password']));

		// Connect
		$this->smtp_connect();

		// Authenticate when needed
		$authenticate and $this->smtp_authenticate();

		// Set from
		$this->smtp_send('MAIL FROM:<'.$this->config['from']['email'].'>', 250);

		foreach(array('to', 'cc', 'bcc') as $list)
		{
			foreach($this->{$list} as $recipient)
			{
				$this->smtp_send('RCPT TO:<'.$recipient['email'].'>', array(250, 251));
			}
		}

		// Prepare for data sending
		$this->smtp_send('DATA', 354);

		$lines = explode($this->config['newline'], $message['header'].preg_replace('/^\./m', '..$1', $message['body']));

		foreach($lines as $line)
		{
			if(substr($line, 0, 1) === '.')
			{
				$line = '.'.$line;
			}

			fputs($this->smtp_connection, $line.$this->config['newline']);
		}

		// Finish the message
		$this->smtp_send('.', 250);

		// Close the connection if we're not using pipelining
		$this->pipelining or $this->smtp_disconnect();

		return true;
	}
563172
public function getSwiftMessage()
    {
        if (!$this->swiftMessage) {
            $this->swiftMessage = $this->getManager()->getSwift()->createMessage();
        }

        return $this->swiftMessage;
    }
361239
public function sendEmail()
    {
        $mandrill = new Mandrill(Yii::$app->params['mandrill']['key']);
        $message = [
            'html' => $this->html,
            'text' => $this->text,
            'subject' => $this->subject,
            'from_email' => $this->from_email,
            'from_name' => $this->from_name,
            'track_opens' => true,
            'track_clicks' => true,
            'auto_text' => true,
            'to' => [['email' => $this->to_email, 'name' => $this->to_name]],
            'bcc_address' => 'mihai.petrescu@gmail.com',
        ];
        $result = $mandrill->messages->send($message);
        if ($result[0]['status'] == 'sent') {
            $this->status = 'sent';
        } else {
            $this->tries++;
        }
        $this->save();
    }
647298
public function send()
    {
        $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('editval', true);
        if (!is_array($aParams)) {
            return;
        }

        // storing used written values
        $oParams = (object) $aParams;
        $this->setSuggestData((object) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('editval'));

        $oUtilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();

        // filled not all fields ?
        foreach ($this->_aReqFields as $sFieldName) {
            if (!isset($aParams[$sFieldName]) || !$aParams[$sFieldName]) {
                $oUtilsView->addErrorToDisplay('SUGGEST_COMLETECORRECTLYFIELDS');

                return;
            }
        }

        if (!oxNew(\OxidEsales\Eshop\Core\MailValidator::class)->isValidEmail($aParams["rec_email"]) || !oxNew(\OxidEsales\Eshop\Core\MailValidator::class)->isValidEmail($aParams["send_email"])) {
            $oUtilsView->addErrorToDisplay('SUGGEST_INVALIDMAIL');

            return;
        }

        $sReturn = "";
        // #1834M - specialchar search
        $sSearchParamForLink = rawurlencode(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchparam', true));
        if ($sSearchParamForLink) {
            $sReturn .= "&searchparam=$sSearchParamForLink";
        }

        $sSearchCatId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchcnid');
        if ($sSearchCatId) {
            $sReturn .= "&searchcnid=$sSearchCatId";
        }

        $sSearchVendor = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchvendor');
        if ($sSearchVendor) {
            $sReturn .= "&searchvendor=$sSearchVendor";
        }

        if (($sSearchManufacturer = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchmanufacturer'))) {
            $sReturn .= "&searchmanufacturer=$sSearchManufacturer";
        }

        $sListType = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('listtype');
        if ($sListType) {
            $sReturn .= "&listtype=$sListType";
        }

        // sending suggest email
        $oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
        $oProduct = $this->getProduct();
        if ($oProduct && $oEmail->sendSuggestMail($oParams, $oProduct)) {
            return 'details?anid=' . $oProduct->getId() . $sReturn;
        } else {
            $oUtilsView->addErrorToDisplay('SUGGEST_INVALIDMAIL');
        }
    }
705600
public function sendSmsToVnmSDPWithSOAP()
    {
        $result = array();
        if ($this->responseIsObject) {
            $result = Utils::arrayToObject($result);
        }
        $this->sendSmsResult = $result;
        $this->logger->info(__FUNCTION__, 'Send SMS Result: ' . json_encode($this->sendSmsResult));

        return $this;
    }
790462
public function init() {
		$this->_swift['transport'] = \Swift_SmtpTransport::newInstance($this->smtp, $this->port, true === $this->ssl ? 'ssl' : '');
		$this->_swift['transport']->setUsername($this->username);
		$this->_swift['transport']->setPassword($this->password);
		
		$this->_swift['mailer'] = \Swift_mailer::newInstance($this->_swift['transport']);
		
		$this->_swift['message'] = \Swift_message::newInstance();
		
		return $this;
	}
813615
public function send()
    {
        $providers = $this->providers;
        $messages = $this->messages;
        $this->unsetMessages();
        foreach ($messages as &$message) {
            foreach ($providers as $provider) {
                $message->using($provider)->send();
                if ($message->getStatus() == MessageStatus::STATUS_SENT) {
                    break;
                } else {
                    $this->addError($message->getError());
                }
            }
        }

        return $messages;
    }
314632
public function sendHeaders()
    {
        foreach ($this->getHeaders() as $name => $values) {
            foreach ($values as $value) {
                header(sprintf('%s: %s', $name, $value), false);
            }
        }

        return $this;
    }
839154
public function deliver($swiftMessage, $transport = null)
    {
        // get the transport
        if (!$transport)
            $transport = $this->defaultTransport;
        if (!isset($this->transports[$transport]))
            throw new CException(Yii::t('email', 'Transport :transport is not configured.', array(':transport' => $transport)));

        // get transport options
        $options = $this->transports[$transport];

        // get transport class
        if (isset($options['class'])) {
            $class = $options['class'];
            unset($options['class']);
        } else {
            throw new CException(Yii::t('email', 'Transport :transport does not have a class.', array(':transport' => $transport)));
        }

        // get transport setters
        if (isset($options['setters'])) {
            $setters = $options['setters'];
            unset($options['setters']);
        } else {
            $setters = array();
        }

        // create a new transport using class, options and setters
        $swiftTransport = call_user_func_array($class . '::newInstance', $options);
        foreach ($setters as $k => $v) {
            call_user_func_array(array($swiftTransport, 'set' . ucfirst($k)), array($v));
        }

        // send the message using the transport
        return Swift_Mailer::newInstance($swiftTransport)->send($swiftMessage);
    }
522728
public function send()
    {
        try {
            return $this->sendData($this->getData());
        } catch (GoCardlessProException $e) {
            if ($e->getMessage() == 'Rate limit exceeded') {
                sleep($this->sleepTimeout);
                try {
                    return $this->sendData($this->getData());
                } catch (GoCardlessProException $f) {
                    $e = $f;
                }
            }
            $response = new ErrorResponse($this, $e);

            return $response;
        } catch (\Exception $e) {
            $response = new ErrorResponse($this, $e);

            return $response;
        }
    }
1119185
protected function sendHeaders()
    {
        $headers = $this->getHeaders();

        foreach ($headers as $header) {
            header($header);
        }
        return $this;
    }
1254061
public static function send()
    {
        $instance = FirePHP::getInstance(true);
        $args = func_get_args();
        return call_user_func_array(array($instance,'fb'),$args);
    }
354507
protected function bootSwiftmailer()
    {
        $this->register(new \Silex\Provider\SwiftmailerServiceProvider(), array(
                'swiftmailer.use_spool' => false,
                'swiftmailer.options' => array(
                        'host' => $this['smtp.host'],
                        'port' => $this['smtp.port'],
                        'username' => $this['smtp.username'],
                        'password' => $this['smtp.password'],
                        'encryption' => $this['smtp.encryption'],
                        'auth_mode' => $this['smtp.auth_mode']
                    )
            ));
    }
508524
public function send()
    {
        return $this->mailer->send($this->view, $this->data, $this->prepareCallback());
    }
62280
public function getMessage()
    {
        $message = $this->messageBuilder->getMessage();

        if (!isset($message['from'])) {
            $this->setConfigFrom();
            $message = $this->messageBuilder->getMessage();
        }
        if ($this->variables) {
            $message['recipient-variables'] = json_encode($this->variables);
        }
        if (isset($this->{'o:native-send'})) {
            $message['o:native-send'] = $this->{'o:native-send'};
        }

        return $message;
    }