protected/commands
-one file name testcommand.php
class TestCommand extends CConsoleCommand
{
public function run($args)
{
/* start of sending mail loop
$message = new YiiMailMessage();
$message->setTo($email_to);
$message->setCc($email_cc);
$message->setBcc($email_bcc);
$message->setFrom($from);
$message->setSubject($email_template->email_template_subject);
$message->setBody($email_template->email_template_body,'text/html');
$resp_value = $mailer->send($message);
$resp_value = $mailer->send($message);
*/
}
}
protected/config
-one more file name modified console.php
<?php
// This is the configuration for yiic console application.
// Any writable CConsoleApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Console Application',
'import'=>array(
'application.models.*',
'application.components.*',
'application.extensions.yii-mail.*',
'application.extensions.crontab.*',
),
// application components
'components'=>array(
'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=db.xyz.org;dbname=easy',
'emulatePrepare' => true,
'username' => 'username',
'password' => '****',
'charset' => 'utf8',
),
// usefull for generating links in email etc...
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName' => FALSE,
'rules'=>array(),
),
),
);
////////////////
/protected/yiic.php
<?php
// change the following paths if necessary
$yiic=dirname(FILE).’/../../yii/framework/yiic.php’;
$config=dirname(FILE).’/config/console.php’;
require_once($yiic);
// remove the following line when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
Yii::createConsoleApplication($config)->run();
///////////////////
1.what are thing’s i missed it?
2.any thing extra need to added?
3.how to run it manually?
thank’s in advance