当前位置: 首页>>代码示例>>PHP>>正文


PHP Email::configTransport方法代码示例

本文整理汇总了PHP中Cake\Network\Email\Email::configTransport方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::configTransport方法的具体用法?PHP Email::configTransport怎么用?PHP Email::configTransport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cake\Network\Email\Email的用法示例。


在下文中一共展示了Email::configTransport方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: email

 public function email()
 {
     if ($this->request->is('get')) {
         $userId = $this->Auth->user('id');
         $username = $this->Auth->user('username');
         $this->loadModel('UserTypes');
         $userTypes = $this->UserTypes->listSubCategories();
         $this->set(compact('userId', 'username', 'userTypes'));
     } else {
         if ($this->request->is('post')) {
             Email::configTransport('gmail', ['host' => 'smtp.gmail.com', 'port' => 587, 'username' => 'ricardohenrique996@gmail.com', 'password' => 'mustang996', 'className' => 'Smtp', 'tls' => true]);
             $email = new Email();
             $email->transport('gmail');
             $email->from(['ricardohenrique996@gmail.com' => 'Store Site'])->to('ricardohenrique1@outlook.com')->emailFormat('html')->subject(FormatContactForm::getSubject($this->request->data['subject'], ['suffix' => ' | Store Site']))->send(FormatContactForm::getMessage($this->request->data, ['uppercaseLabel' => true]));
             return $this->redirect(['controller' => 'CustomStaticPages', 'action' => 'index']);
         }
     }
 }
开发者ID:ricardohenriq,项目名称:shooping,代码行数:18,代码来源:CustomStaticPagesController.php

示例2: env

 * If you define fullBaseUrl in your config file you can remove this.
 */
if (!Configure::read('App.fullBaseUrl')) {
    $s = null;
    if (env('HTTPS')) {
        $s = 's';
    }
    $httpHost = env('HTTP_HOST');
    if (isset($httpHost)) {
        Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost);
    }
    unset($httpHost, $s);
}
Cache::config(Configure::consume('Cache'));
ConnectionManager::config(Configure::consume('Datasources'));
Email::configTransport(Configure::consume('EmailTransport'));
Email::config(Configure::consume('Email'));
Log::config(Configure::consume('Log'));
Security::salt(Configure::consume('Security.salt'));
/**
 * The default crypto extension in 3.0 is OpenSSL.
 * If you are migrating from 2.x uncomment this code to
 * use a more compatible Mcrypt based implementation
 */
// Security::engine(new \Cake\Utility\Crypto\Mcrypt());
/**
 * Setup detectors for mobile and tablet.
 */
Request::addDetector('mobile', function ($request) {
    $detector = new \Detection\MobileDetect();
    return $detector->isMobile();
开发者ID:sleeping-lion,项目名称:slboard_cakephp3,代码行数:31,代码来源:bootstrap.php

示例3: testMockTransport

 /**
  * CakeEmailTest::testMockTransport()
  */
 public function testMockTransport()
 {
     $mock = $this->getMock('\\Cake\\Network\\Email\\AbstractTransport');
     $config = array('from' => 'tester@example.org', 'transport' => 'default');
     Email::config('default', $config);
     Email::configTransport('default', $mock);
     $em = new Email('default');
     $this->assertSame($mock, $em->transport());
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:12,代码来源:EmailTest.php

示例4: env

if (!Configure::read('App.fullBaseUrl')) {
    $s = null;
    if (env('HTTPS')) {
        $s = 's';
    }
    $httpHost = env('HTTP_HOST');
    if (isset($httpHost)) {
        Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost);
    }
    unset($httpHost, $s);
}
Cache::config(Configure::consume('Cache'));
ConnectionManager::config(Configure::consume('Datasources'));
Email::configTransport(Configure::consume('EmailTransport'));
Email::config(Configure::consume('Email'));
Email::configTransport('sparkpost', ['className' => 'SparkPost.SparkPost', 'apiKey' => Configure::read('SparkPost.Api.key')]);
Log::config(Configure::consume('Log'));
Security::salt(Configure::consume('Security.salt'));
/**
 * The default crypto extension in 3.0 is OpenSSL.
 * If you are migrating from 2.x uncomment this code to
 * use a more compatible Mcrypt based implementation
 */
// Security::engine(new \Cake\Utility\Crypto\Mcrypt());
/**
 * Setup detectors for mobile and tablet.
 */
Request::addDetector('mobile', function ($request) {
    $detector = new \Detection\MobileDetect();
    return $detector->isMobile();
});
开发者ID:CubScoutCake,项目名称:CubEventBooking,代码行数:31,代码来源:bootstrap.php

示例5: testDropTransport

 /**
  * Test dropping a transport configuration
  *
  * @return void
  */
 public function testDropTransport()
 {
     $result = Email::configTransport('debug');
     $this->assertInternalType('array', $result, 'Should have config data');
     Email::dropTransport('debug');
     $this->assertNull(Email::configTransport('debug'), 'Should not exist.');
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:12,代码来源:EmailTest.php

示例6: array

    Configure::write('debug', 1);
    if (Configure::read('debug')) {
        Plugin::load('DebugKit', ['bootstrap' => true]);
    }
    Configure::write('environment', 'local');
    ConnectionManager::config('default', ['className' => 'Cake\\Database\\Connection', 'driver' => 'Cake\\Database\\Driver\\Mysql', 'persistent' => false, 'host' => 'localhost', 'username' => 'root', 'password' => '', 'database' => 'test_be', 'encoding' => 'utf8', 'timezone' => 'UTC', 'cacheMetadata' => true, 'quoteIdentifiers' => false]);
    Email::configTransport('smtp', ['className' => 'Smtp', 'host' => 'ssl://smtp.gmail.com', 'port' => 465, 'timeout' => 30, 'username' => 'briefing@bliss-interactive.com', 'password' => 'bliss421briefing']);
    Configure::write('ga_account', array('en' => 'UA-35390446-3', 'fr' => 'UA-35390446-3', 'nl' => 'UA-35390446-3'));
} else {
    if (strpos($domain_name, "happiness-brussels.com") !== FALSE || strpos($domain_name, "bliss-interactive.net") !== FALSE) {
        Configure::write('debug', 0);
        if (Configure::read('debug')) {
            Plugin::load('DebugKit', ['bootstrap' => true]);
        }
        Configure::write('environment', 'preview');
        ConnectionManager::config('default', ['className' => 'Cake\\Database\\Connection', 'driver' => 'Cake\\Database\\Driver\\Mysql', 'persistent' => false, 'host' => 'localhost', 'username' => 'pre_hb_user', 'password' => 'MHmRh9Qa3S2HHAYx', 'database' => 'database', 'encoding' => 'utf8', 'timezone' => 'UTC', 'cacheMetadata' => true, 'quoteIdentifiers' => false]);
        Email::configTransport('smtp', ['className' => 'Smtp', 'host' => 'localhost', 'port' => 25, 'timeout' => 30, 'username' => NULL, 'password' => NULL]);
        Configure::write('ga_account', array('en' => 'UA-35390446-3', 'fr' => 'UA-35390446-3', 'nl' => 'UA-35390446-3'));
    } else {
        //date_default_timezone_set("Europe/Brussels");
        Configure::write('debug', 0);
        if (Configure::read('debug')) {
            Plugin::load('DebugKit', ['bootstrap' => true]);
        }
        Configure::write('environment', 'live');
        ConnectionManager::config('default', ['className' => 'Cake\\Database\\Connection', 'driver' => 'Cake\\Database\\Driver\\Mysql', 'persistent' => false, 'host' => 'localhost', 'username' => '', 'password' => '', 'database' => 'database', 'encoding' => 'utf8', 'timezone' => 'UTC', 'cacheMetadata' => true, 'quoteIdentifiers' => false]);
        Email::configTransport('smtp', ['className' => 'Smtp', 'host' => 'localhost', 'port' => 25, 'timeout' => 30, 'username' => NULL, 'password' => NULL]);
        Configure::write('ga_account', array('en' => 'UA-35390446-3', 'fr' => 'UA-35390446-3', 'nl' => 'UA-35390446-3'));
    }
}
Configure::write('Session', array('defaults' => 'php', 'cookie' => 'TESTBE', 'timeout' => 60));
开发者ID:hongtien510,项目名称:cakephp-routing,代码行数:31,代码来源:bootstrap.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     Email::configTransport('test', ['className' => 'Debug']);
     $this->Email = new Email(['transport' => 'test', 'to' => 'jane@doe.com', 'from' => 'john@doe.com', 'helpers' => ['Html', 'Gourmet/Email.Email'], 'layout' => 'Gourmet/Email.default', 'emailFormat' => 'both']);
 }
开发者ID:gourmet,项目名称:email,代码行数:6,代码来源:EmailTest.php


注:本文中的Cake\Network\Email\Email::configTransport方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。