コード例 #1
0
 /**
  * Test sending emails via CLI and Queue transport.
  *
  * @return void
  */
 public function complete_email()
 {
     Configure::write('debug', 0);
     $Email = new Email();
     $Email->to('*****@*****.**', 'Mark Test');
     $Email->subject('Testing Message');
     $host = Configure::read('App.host');
     if ($host) {
         $Email->domain($host);
     }
     $config = $Email->config();
     if (!isset($config['queue'])) {
         return $this->error('queue key in config missing');
     }
     $res = $Email->send('Foo');
     if (!$res) {
         return $this->error('Could not send email: ' . $Email->getError());
     }
     $this->out('YEAH!');
 }
コード例 #2
0
ファイル: EmailTest.php プロジェクト: repher/cakephp-tools
 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     Log::drop('email');
     Email::drop('test');
     Email::dropTransport('debug');
     Email::dropTransport('test_smtp');
 }