/** * 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!'); }
/** * tearDown method * * @return void */ public function tearDown() { parent::tearDown(); Log::drop('email'); Email::drop('test'); Email::dropTransport('debug'); Email::dropTransport('test_smtp'); }