Send email reminder with Cronjob in yii1

I need to implement a reminder to notify by email, I have read about cronjobs, but I still don’t know how to implement this with yii 1.

Hello, you can launch Yii console applications by creating console controllers in ‘commands’ directory.

class TestCommand extends CConsoleCommand
   public function actionFoo( $args ) { echo "Hello World\n"; }

that you can run with :
php -f yiic.php test foo

Hi! yes, i can do it, but when call my database, the command not work.

 class CronjobCommand extends CConsoleCommand{

	public function actionNotificarJustificativo(){


and in justificativo::model

    public function test(){
        	echo Justificativo::model()->findAll();


I need work with database for send emails.

and in command:

The configuration file used in console mode is different from the one used for Web Application (console.php versus main.php maybe) : check the configuration file you are using.
One strange thing, that was fixed in Yii next versions is that you must declare a variable $config before invoking Yii console engine :

$config = __DIR__.'/config/console.php';
echo "*** config: $config\n";
require_once( 'yiic.php' );

where would this variable go, $config? in CronjobCommand maybe?

$config = __DIR__.'/config/console.php';
 echo "*** config: $config\n";
 require_once( 'yiic.php' );

In the yiic.php bootstrap file, should be in protected directory (CronJob.php is too late !)
Another weird stuff: there are 2 yiic.php files, the other one is in the framework.

Você é brasileiro ?

No dude, i’m Chilean, thanks for the answers but i can’t see how to resolve this. :frowning:

Are you using SQLite ? That would explain the ‘file not found’ error you are getting.
What do you have in your yiic file ?
Can you also print your database configuration as actionNotificarJustificativo() sees it, maybe with sthing like this:
echo Yii::app()->db->connectionString;
echo Yii::app()->db->userName;

Dude!! finally i can conect to my database, now i try to send an email but i have problems with the configuration i think.

thanks again for your answers!!!