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;
	}
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;
	}
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 ; }
Send the message

@return  object
Send the message