當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Swift_Transport_EsmtpTransport::setAuthMode方法代碼示例

本文整理匯總了PHP中Swift_Transport_EsmtpTransport::setAuthMode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Swift_Transport_EsmtpTransport::setAuthMode方法的具體用法?PHP Swift_Transport_EsmtpTransport::setAuthMode怎麽用?PHP Swift_Transport_EsmtpTransport::setAuthMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Swift_Transport_EsmtpTransport的用法示例。


在下文中一共展示了Swift_Transport_EsmtpTransport::setAuthMode方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: register

 public function register(Application $app)
 {
     $app['swiftmailer.options'] = array_replace(array('host' => 'localhost', 'port' => 25, 'username' => '', 'password' => '', 'encryption' => null, 'auth_mode' => null), isset($app['swiftmailer.options']) ? $app['swiftmailer.options'] : array());
     $app['mailer'] = $app->share(function () use($app) {
         $r = new \ReflectionClass('Swift_Mailer');
         require_once dirname($r->getFilename()) . '/../../swift_init.php';
         return new \Swift_Mailer($app['swiftmailer.transport']);
     });
     $app['swiftmailer.transport'] = $app->share(function () use($app) {
         $transport = new \Swift_Transport_EsmtpTransport($app['swiftmailer.transport.buffer'], array($app['swiftmailer.transport.authhandler']), $app['swiftmailer.transport.eventdispatcher']);
         $transport->setHost($app['swiftmailer.options']['host']);
         $transport->setPort($app['swiftmailer.options']['port']);
         $transport->setEncryption($app['swiftmailer.options']['encryption']);
         $transport->setUsername($app['swiftmailer.options']['username']);
         $transport->setPassword($app['swiftmailer.options']['password']);
         $transport->setAuthMode($app['swiftmailer.options']['auth_mode']);
         return $transport;
     });
     $app['swiftmailer.transport.buffer'] = $app->share(function () {
         return new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory());
     });
     $app['swiftmailer.transport.authhandler'] = $app->share(function () {
         return new \Swift_Transport_Esmtp_AuthHandler(array(new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), new \Swift_Transport_Esmtp_Auth_PlainAuthenticator()));
     });
     $app['swiftmailer.transport.eventdispatcher'] = $app->share(function () {
         return new \Swift_Events_SimpleEventDispatcher();
     });
     if (isset($app['swiftmailer.class_path'])) {
         $app['autoloader']->registerPrefix('Swift_', $app['swiftmailer.class_path']);
     }
 }
開發者ID:nooks,項目名稱:Silex,代碼行數:31,代碼來源:SwiftmailerExtension.php

示例2: register

 public function register(Application $app)
 {
     $app['swiftmailer.options'] = array();
     $app['mailer.initialized'] = false;
     $app['mailer'] = $app->share(function ($app) {
         $app['mailer.initialized'] = true;
         return new \Swift_Mailer($app['swiftmailer.spooltransport']);
     });
     $app['swiftmailer.spooltransport'] = $app->share(function ($app) {
         return new \Swift_SpoolTransport($app['swiftmailer.spool']);
     });
     $app['swiftmailer.spool'] = $app->share(function ($app) {
         return new \Swift_MemorySpool();
     });
     $app['swiftmailer.transport'] = $app->share(function ($app) {
         $transport = new \Swift_Transport_EsmtpTransport($app['swiftmailer.transport.buffer'], array($app['swiftmailer.transport.authhandler']), $app['swiftmailer.transport.eventdispatcher']);
         $options = $app['swiftmailer.options'] = array_replace(array('host' => 'localhost', 'port' => 25, 'username' => '', 'password' => '', 'encryption' => null, 'auth_mode' => null), $app['swiftmailer.options']);
         $transport->setHost($options['host']);
         $transport->setPort($options['port']);
         $transport->setEncryption($options['encryption']);
         $transport->setUsername($options['username']);
         $transport->setPassword($options['password']);
         $transport->setAuthMode($options['auth_mode']);
         return $transport;
     });
     $app['swiftmailer.transport.buffer'] = $app->share(function () {
         return new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory());
     });
     $app['swiftmailer.transport.authhandler'] = $app->share(function () {
         return new \Swift_Transport_Esmtp_AuthHandler(array(new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), new \Swift_Transport_Esmtp_Auth_PlainAuthenticator()));
     });
     $app['swiftmailer.transport.eventdispatcher'] = $app->share(function () {
         return new \Swift_Events_SimpleEventDispatcher();
     });
 }
開發者ID:hafedhbou,項目名稱:hetic-p2017,代碼行數:35,代碼來源:SwiftmailerServiceProvider.php

示例3: createSmtp

 protected function createSmtp(array $config)
 {
     $buffer = new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory());
     $auth = new \Swift_Transport_Esmtp_AuthHandler([new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), new \Swift_Transport_Esmtp_Auth_PlainAuthenticator()]);
     $transport = new \Swift_Transport_EsmtpTransport($buffer, [$auth], $this->dispatcher);
     $transport->setHost($config['host']);
     $transport->setPort($config['port']);
     $transport->setUsername($config['username']);
     $transport->setPassword($config['password']);
     $transport->setEncryption($config['encryption']);
     $transport->setAuthMode($config['auth_mode']);
     return $transport;
 }
開發者ID:glynnforrest,項目名稱:neptune,代碼行數:13,代碼來源:SwiftmailerFactory.php

示例4: register

 public function register(Container $app)
 {
     $app['swiftmailer.options'] = array();
     $app['swiftmailer.use_spool'] = true;
     $app['mailer.initialized'] = false;
     $app['mailer'] = function ($app) {
         $app['mailer.initialized'] = true;
         $transport = $app['swiftmailer.use_spool'] ? $app['swiftmailer.spooltransport'] : $app['swiftmailer.transport'];
         return new \Swift_Mailer($transport);
     };
     $app['swiftmailer.spooltransport'] = function ($app) {
         return new \Swift_Transport_SpoolTransport($app['swiftmailer.transport.eventdispatcher'], $app['swiftmailer.spool']);
     };
     $app['swiftmailer.spool'] = function ($app) {
         return new \Swift_MemorySpool();
     };
     $app['swiftmailer.transport'] = function ($app) {
         $transport = new \Swift_Transport_EsmtpTransport($app['swiftmailer.transport.buffer'], array($app['swiftmailer.transport.authhandler']), $app['swiftmailer.transport.eventdispatcher']);
         $options = $app['swiftmailer.options'] = array_replace(array('host' => 'localhost', 'port' => 25, 'username' => '', 'password' => '', 'encryption' => null, 'auth_mode' => null), $app['swiftmailer.options']);
         $transport->setHost($options['host']);
         $transport->setPort($options['port']);
         $transport->setEncryption($options['encryption']);
         $transport->setUsername($options['username']);
         $transport->setPassword($options['password']);
         $transport->setAuthMode($options['auth_mode']);
         if (null !== $app['swiftmailer.sender_address']) {
             $transport->registerPlugin(new \Swift_Plugins_ImpersonatePlugin($app['swiftmailer.sender_address']));
         }
         if (!empty($app['swiftmailer.delivery_addresses'])) {
             $transport->registerPlugin(new \Swift_Plugins_RedirectingPlugin($app['swiftmailer.delivery_addresses'], $app['swiftmailer.delivery_whitelist']));
         }
         return $transport;
     };
     $app['swiftmailer.transport.buffer'] = function () {
         return new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory());
     };
     $app['swiftmailer.transport.authhandler'] = function () {
         return new \Swift_Transport_Esmtp_AuthHandler(array(new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), new \Swift_Transport_Esmtp_Auth_PlainAuthenticator()));
     };
     $app['swiftmailer.transport.eventdispatcher'] = function () {
         return new \Swift_Events_SimpleEventDispatcher();
     };
     $app['swiftmailer.sender_address'] = null;
     $app['swiftmailer.delivery_addresses'] = [];
     $app['swiftmailer.delivery_whitelist'] = [];
 }
開發者ID:abdonor,項目名稱:silex_simple_api,代碼行數:46,代碼來源:SwiftmailerServiceProvider.php

示例5: register

 public function register(Container $c)
 {
     $c['swiftmailer.use_spool'] = true;
     $c['mailer.initialized'] = false;
     $c['mailer'] = function ($c) {
         $c['mailer.initialized'] = true;
         $transport = $c['swiftmailer.use_spool'] ? $c['swiftmailer.spooltransport'] : $c['swiftmailer.transport'];
         return new \Swift_Mailer($transport);
     };
     $c['swiftmailer.spooltransport'] = function ($c) {
         return new \Swift_Transport_SpoolTransport($c['swiftmailer.transport.eventdispatcher'], $c['swiftmailer.spool']);
     };
     $c['swiftmailer.spool'] = function ($c) {
         return new \Swift_MemorySpool();
     };
     $c['swiftmailer.transport'] = function ($c) {
         $settings = $c["settings"]["swiftmailer"];
         $transport = new \Swift_Transport_EsmtpTransport($c['swiftmailer.transport.buffer'], array($c['swiftmailer.transport.authhandler']), $c['swiftmailer.transport.eventdispatcher']);
         $settings = array_replace(array('host' => 'localhost', 'port' => 25, 'username' => '', 'password' => '', 'encryption' => null, 'auth_mode' => null), $settings);
         $transport->setHost($settings['host']);
         $transport->setPort($settings['port']);
         $transport->setEncryption($settings['encryption']);
         $transport->setUsername($settings['username']);
         $transport->setPassword($settings['password']);
         $transport->setAuthMode($settings['auth_mode']);
         return $transport;
     };
     $c['swiftmailer.transport.buffer'] = function ($c) {
         return new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory());
     };
     $c['swiftmailer.transport.authhandler'] = function ($c) {
         return new \Swift_Transport_Esmtp_AuthHandler(array(new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), new \Swift_Transport_Esmtp_Auth_PlainAuthenticator()));
     };
     $c['swiftmailer.transport.eventdispatcher'] = function ($c) {
         return new \Swift_Events_SimpleEventDispatcher();
     };
 }
開發者ID:MhmdLab,項目名稱:slim-swiftmailer,代碼行數:37,代碼來源:SwiftmailerServiceProvider.php

示例6: getSwiftmailer_TransportService

 /**
  * Gets the 'swiftmailer.transport' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return Swift_Transport_EsmtpTransport A Swift_Transport_EsmtpTransport instance.
  */
 protected function getSwiftmailer_TransportService()
 {
     $this->services['swiftmailer.transport'] = $instance = new \Swift_Transport_EsmtpTransport(new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory()), array(0 => new \Swift_Transport_Esmtp_AuthHandler(array(0 => new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), 1 => new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), 2 => new \Swift_Transport_Esmtp_Auth_PlainAuthenticator()))), new \Swift_Events_SimpleEventDispatcher());
     $instance->setHost('localhost');
     $instance->setPort(25);
     $instance->setEncryption(NULL);
     $instance->setUsername('');
     $instance->setPassword('');
     $instance->setAuthMode(NULL);
     $instance->registerPlugin($this->get('swiftmailer.plugin.messagelogger'));
     return $instance;
 }
開發者ID:rfc1483,項目名稱:dobervich,代碼行數:20,代碼來源:appDevDebugProjectContainer.php

示例7: getSwiftmailer_Mailer_Default_Transport_RealService

 protected function getSwiftmailer_Mailer_Default_Transport_RealService()
 {
     $this->services['swiftmailer.mailer.default.transport.real'] = $instance = new \Swift_Transport_EsmtpTransport(new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory()), array(0 => new \Swift_Transport_Esmtp_AuthHandler(array(0 => new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), 1 => new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), 2 => new \Swift_Transport_Esmtp_Auth_PlainAuthenticator()))), $this->get('swiftmailer.mailer.default.transport.eventdispatcher'));
     $instance->setHost('127.0.0.1');
     $instance->setPort(25);
     $instance->setEncryption(NULL);
     $instance->setUsername(NULL);
     $instance->setPassword(NULL);
     $instance->setAuthMode(NULL);
     $instance->setTimeout(30);
     $instance->setSourceIp(NULL);
     return $instance;
 }
開發者ID:acappel01,項目名稱:opencall,代碼行數:13,代碼來源:appProdProjectContainer.php

示例8: function

 $app['mailer'] = function ($app) {
     $app['mailer.initialized'] = true;
     $mailer = new Mailer($app['swift.transport'], $app['swift.spooltransport']);
     $mailer->registerPlugin(new ImpersonatePlugin($this->config['from_address'], $this->config['from_name']));
     return $mailer;
 };
 $app['mailer.initialized'] = false;
 $app['swift.transport'] = function ($app) {
     if ('smtp' == $this->config['driver']) {
         $transport = new Swift_Transport_EsmtpTransport($app['swift.transport.buffer'], [$app['swift.transport.authhandler']], $app['swift.transport.eventdispatcher']);
         $transport->setHost($this->config['host']);
         $transport->setPort($this->config['port']);
         $transport->setUsername($this->config['username']);
         $transport->setPassword($this->config['password']);
         $transport->setEncryption($this->config['encryption']);
         $transport->setAuthMode($this->config['auth_mode']);
         return $transport;
     }
     if ('mail' == $this->config['driver']) {
         return Swift_MailTransport::newInstance();
     }
     throw new \InvalidArgumentException('Invalid mail driver.');
 };
 $app['swift.transport.buffer'] = function () {
     return new Swift_Transport_StreamBuffer(new Swift_StreamFilters_StringReplacementFilterFactory());
 };
 $app['swift.transport.authhandler'] = function () {
     return new Swift_Transport_Esmtp_AuthHandler([new Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), new Swift_Transport_Esmtp_Auth_LoginAuthenticator(), new Swift_Transport_Esmtp_Auth_PlainAuthenticator()]);
 };
 $app['swift.transport.eventdispatcher'] = function () {
     return new Swift_Events_SimpleEventDispatcher();
開發者ID:LibraryOfLawrence,項目名稱:pagekit,代碼行數:31,代碼來源:index.php

示例9: setupSwiftMailer

 private function setupSwiftMailer()
 {
     $this['swiftmailer.transport'] = $this->share(function (Application $app) {
         if ($app['conf']->get(['registry', 'email', 'smtp-enabled'])) {
             $transport = new \Swift_Transport_EsmtpTransport($app['swiftmailer.transport.buffer'], [$app['swiftmailer.transport.authhandler']], $app['swiftmailer.transport.eventdispatcher']);
             $encryption = null;
             if (in_array($app['conf']->get(['registry', 'email', 'smtp-secure-mode']), ['ssl', 'tls'])) {
                 $encryption = $app['conf']->get(['registry', 'email', 'smtp-secure-mode']);
             }
             $options = $app['swiftmailer.options'] = array_replace(['host' => $app['conf']->get(['registry', 'email', 'smtp-host']), 'port' => $app['conf']->get(['registry', 'email', 'smtp-port']), 'username' => $app['conf']->get(['registry', 'email', 'smtp-user']), 'password' => $app['conf']->get(['registry', 'email', 'smtp-password']), 'encryption' => $encryption, 'auth_mode' => null], $app['swiftmailer.options']);
             $transport->setHost($options['host']);
             $transport->setPort($options['port']);
             // tls or ssl
             $transport->setEncryption($options['encryption']);
             if ($app['conf']->get(['registry', 'email', 'smtp-auth-enabled'])) {
                 $transport->setUsername($options['username']);
                 $transport->setPassword($options['password']);
                 $transport->setAuthMode($options['auth_mode']);
             }
         } else {
             $transport = new \Swift_Transport_MailTransport(new \Swift_Transport_SimpleMailInvoker(), $app['swiftmailer.transport.eventdispatcher']);
         }
         return $transport;
     });
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:25,代碼來源:Application.php

示例10: getSwiftmailer_TransportService

 protected function getSwiftmailer_TransportService()
 {
     $this->services['swiftmailer.transport'] = $instance = new \Swift_Transport_EsmtpTransport(new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory()), array(0 => new \Swift_Transport_Esmtp_AuthHandler(array(0 => new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), 1 => new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), 2 => new \Swift_Transport_Esmtp_Auth_PlainAuthenticator()))), new \Swift_Events_SimpleEventDispatcher());
     $instance->setHost('smtp.gmail.com');
     $instance->setPort(465);
     $instance->setEncryption('ssl');
     $instance->setUsername('richpolis');
     $instance->setPassword('D3m3s1s1');
     $instance->setAuthMode('login');
     return $instance;
 }
開發者ID:richpolis,項目名稱:sf2Pruebas,代碼行數:11,代碼來源:appProdProjectContainer.php

示例11: __construct


//.........這裏部分代碼省略.........
         $translator->addResource('xlf', __DIR__ . '/../../../resources/locales/messages.nl.xlf', 'nl', 'messages');
         $translator->addResource('xlf', __DIR__ . '/../../../resources/locales/validators.nl.xlf', 'nl', 'validators');
         return $translator;
     }));
     $this->register(new FormServiceProvider());
     $this['form.type.extensions'] = $this->share($this->extend('form.type.extensions', function ($extensions) {
         $extensions[] = new HelpTypeExtension();
         return $extensions;
     }));
     $this->setupTwig();
     $this->register(new UnoconvServiceProvider());
     $this->register(new UrlGeneratorServiceProvider());
     $this->setupUrlGenerator();
     $this->register(new UnicodeServiceProvider());
     $this->register(new ValidatorServiceProvider());
     $this->register(new XPDFServiceProvider());
     $this->register(new FileServeServiceProvider());
     $this->register(new ManipulatorServiceProvider());
     $this->register(new PluginServiceProvider());
     $this['phraseanet.exception_handler'] = $this->share(function ($app) {
         $handler = PhraseaExceptionHandler::register($app['debug']);
         $handler->setTranslator($app['translator']);
         return $handler;
     });
     $this['swiftmailer.transport'] = $this->share(function ($app) {
         if ($app['conf']->get(['registry', 'email', 'smtp-enabled'])) {
             $transport = new \Swift_Transport_EsmtpTransport($app['swiftmailer.transport.buffer'], [$app['swiftmailer.transport.authhandler']], $app['swiftmailer.transport.eventdispatcher']);
             $encryption = null;
             if (in_array($app['conf']->get(['registry', 'email', 'smtp-secure-mode']), ['ssl', 'tls'])) {
                 $encryption = $app['conf']->get(['registry', 'email', 'smtp-secure-mode']);
             }
             $options = $app['swiftmailer.options'] = array_replace(['host' => $app['conf']->get(['registry', 'email', 'smtp-host']), 'port' => $app['conf']->get(['registry', 'email', 'smtp-port']), 'username' => $app['conf']->get(['registry', 'email', 'smtp-user']), 'password' => $app['conf']->get(['registry', 'email', 'smtp-password']), 'encryption' => $encryption, 'auth_mode' => null], $app['swiftmailer.options']);
             $transport->setHost($options['host']);
             $transport->setPort($options['port']);
             // tls or ssl
             $transport->setEncryption($options['encryption']);
             if ($app['conf']->get(['registry', 'email', 'smtp-auth-enabled'])) {
                 $transport->setUsername($options['username']);
                 $transport->setPassword($options['password']);
                 $transport->setAuthMode($options['auth_mode']);
             }
         } else {
             $transport = new \Swift_Transport_MailTransport(new \Swift_Transport_SimpleMailInvoker(), $app['swiftmailer.transport.eventdispatcher']);
         }
         return $transport;
     });
     $this['imagine.factory'] = $this->share(function (Application $app) {
         if ($app['conf']->get(['registry', 'executables', 'imagine-driver']) != '') {
             return $app['conf']->get(['registry', 'executables', 'imagine-driver']);
         }
         if (class_exists('\\Gmagick')) {
             return 'gmagick';
         }
         if (class_exists('\\Imagick')) {
             return 'imagick';
         }
         if (extension_loaded('gd')) {
             return 'gd';
         }
         throw new \RuntimeException('No Imagine driver available');
     });
     $app = $this;
     $this['phraseanet.logger'] = $this->protect(function ($databox) use($app) {
         try {
             return \Session_Logger::load($app, $databox);
         } catch (\Exception_Session_LoggerNotFound $e) {
             return \Session_Logger::create($app, $databox, $app['browser']);
         }
     });
     $this['date-formatter'] = $this->share(function (Application $app) {
         return new \phraseadate($app);
     });
     $this['xpdf.pdftotext'] = $this->share($this->extend('xpdf.pdftotext', function (PdfToText $pdftotext, Application $app) {
         if ($app['conf']->get(['registry', 'executables', 'pdf-max-pages'])) {
             $pdftotext->setPageQuantity($app['conf']->get(['registry', 'executables', 'pdf-max-pages']));
         }
         return $pdftotext;
     }));
     $this['dispatcher'] = $this->share($this->extend('dispatcher', function ($dispatcher, Application $app) {
         $dispatcher->addListener(KernelEvents::REQUEST, [$app, 'initSession'], 254);
         $dispatcher->addListener(KernelEvents::RESPONSE, [$app, 'addUTF8Charset'], -128);
         $dispatcher->addSubscriber(new LogoutSubscriber());
         $dispatcher->addSubscriber(new PhraseaLocaleSubscriber($app));
         $dispatcher->addSubscriber(new MaintenanceSubscriber($app));
         $dispatcher->addSubscriber(new CookiesDisablerSubscriber($app));
         return $dispatcher;
     }));
     $this['log.channels'] = ['monolog', 'task-manager.logger'];
     $this->register(new LocaleServiceProvider());
     $this->mount('/include/minify/', new Minifier());
     $this->mount('/permalink/', new Permalink());
     $this->mount('/lightbox/', new Lightbox());
     $app['plugins.directory'] = $app->share(function () {
         $dir = __DIR__ . '/../../../plugins';
         if (is_dir($dir)) {
             return realpath($dir);
         }
         return $dir;
     });
 }
開發者ID:romainneutron,項目名稱:Phraseanet,代碼行數:101,代碼來源:Application.php

示例12: registerEmailServices

 private function registerEmailServices(Application $app)
 {
     $emailConfig = $this->config['notifications']['email'];
     $app['devture_nagios.notification.email.sender_email_address'] = $emailConfig['sender_email_address'];
     $app['devture_nagios.notification.email.transport.auth_handler'] = $app->share(function () {
         return new \Swift_Transport_Esmtp_AuthHandler(array(new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), new \Swift_Transport_Esmtp_Auth_PlainAuthenticator()));
     });
     $app['devture_nagios.notification.email.transport.buffer'] = $app->share(function () {
         return new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory());
     });
     $app['devture_nagios.notification.email.transport.event_dispatcher'] = $app->share(function () {
         return new \Swift_Events_SimpleEventDispatcher();
     });
     $app['devture_nagios.notification.email.transport'] = $app->share(function ($app) use($emailConfig) {
         $transport = new \Swift_Transport_EsmtpTransport($app['devture_nagios.notification.email.transport.buffer'], array($app['devture_nagios.notification.email.transport.auth_handler']), $app['devture_nagios.notification.email.transport.event_dispatcher']);
         $transport->setHost($emailConfig['host']);
         $transport->setPort($emailConfig['port']);
         $transport->setUsername($emailConfig['username']);
         $transport->setPassword($emailConfig['password']);
         $transport->setEncryption($emailConfig['encryption']);
         $transport->setAuthMode($emailConfig['auth_mode']);
         return $transport;
     });
     $app['devture_nagios.notification.email.mailer'] = $app->share(function ($app) {
         return new \Swift_Mailer($app['devture_nagios.notification.email.transport']);
     });
 }
開發者ID:devture,項目名稱:nagadmin,代碼行數:27,代碼來源:ServicesProvider.php

示例13: getSwiftmailer_Transport_RealService

 /**
  * Gets the 'swiftmailer.transport.real' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return Swift_Transport_EsmtpTransport A Swift_Transport_EsmtpTransport instance.
  */
 protected function getSwiftmailer_Transport_RealService()
 {
     $this->services['swiftmailer.transport.real'] = $instance = new \Swift_Transport_EsmtpTransport(new \Swift_Transport_StreamBuffer(new \Swift_StreamFilters_StringReplacementFilterFactory()), array(0 => new \Swift_Transport_Esmtp_AuthHandler(array(0 => new \Swift_Transport_Esmtp_Auth_CramMd5Authenticator(), 1 => new \Swift_Transport_Esmtp_Auth_LoginAuthenticator(), 2 => new \Swift_Transport_Esmtp_Auth_PlainAuthenticator()))), $this->get('swiftmailer.transport.eventdispatcher'));
     $instance->setHost('smtp.gmail.com');
     $instance->setPort(465);
     $instance->setEncryption('ssl');
     $instance->setUsername('admin@buggl.com');
     $instance->setPassword('sleeper16');
     $instance->setAuthMode('login');
     $instance->setTimeout(30);
     $instance->setSourceIp(NULL);
     return $instance;
 }
開發者ID:thebuggl-org,項目名稱:tests-buggl,代碼行數:21,代碼來源:appDevDebugProjectContainer.php


注:本文中的Swift_Transport_EsmtpTransport::setAuthMode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。