title: Yii: console cron application is not sending email
body: <p>My console cron application is not sending email. Mail sending works with web-app perfect. Should I configure some option or could you give me right direction?</p>
  
  <p><strong>protected/cron.php:</strong></p>
  
  <pre><code>&lt;?php
   require_once(dirname(__FILE__) . '/../components/helpers.php');
   return array(
  'basePath'   =&gt; dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
  'name'       =&gt; 'Cron',
  'preload'    =&gt; array('log'),
  'import'     =&gt; array(
      'application.models.*',
      'application.components.*',
  ),
  'components' =&gt; array(
      'cache'        =&gt; array(
          'class' =&gt; 'system.caching.CFileCache'
      ),
  
      'mail'         =&gt; array(
          'class'         =&gt; 'ext.yii-mail.YiiMail',
          'transportType' =&gt; 'php',
          'viewPath'      =&gt; 'application.views.mail',
          'logging'       =&gt; false,
          'dryRun'        =&gt; false,
      ),        
  ),
  'params'     =&gt; array(
      'adminEmail' =&gt; 'some_email@he.re',
  ),
  </code></pre>
  
  <p>);</p>
  
  <p>And email sending method on my model:</p>
  
  <pre><code>public function sendEmail()
      {
          if ($this-&gt;mail) {
              if ($this-&gt;user-&gt;email) {
                  try {
                      $notification = $this-&gt;notification;
                      Yii::import('ext.yii-mail.YiiMailMessage');
                      $params           = array('notification' =&gt; $notification);
                      $message          = new YiiMailMessage;
                      $message-&gt;view    = "notification";
                      $message-&gt;subject = __('MyApp: title', array(':title' =&gt; $notification-&gt;title));
                      $message-&gt;from    = Yii::app()-&gt;params['adminEmail'];
  
                      $message-&gt;setBody("dasdasd");
                      $message-&gt;setTo($this-&gt;user-&gt;email);
  
                      if (Yii::app()-&gt;mail-&gt;send($message) &gt; 0) {
                          $cmd = Yii::app()-&gt;db-&gt;createCommand();
                          $cmd-&gt;update($this-&gt;tableName(), array('mail' =&gt; 1), "id={$this-&gt;id}");
                          print_r($this-&gt;getAttributes());
                      }
                  } catch (Exception $e) {
                      Yii::log($e-&gt;getMessage(), CLogger::LEVEL_ERROR);
                  }
              }
          }
      }
  </code></pre>
  
  <p>cron.php on web-root:</p>
  
  <pre><code>&lt;?php
  defined('YII_DEBUG') or define('YII_DEBUG',true);
  require_once('../yii/framework/yii.php');
  
  $configFile='protected/config/cron.php';
  Yii::createConsoleApplication($configFile)-&gt;run();
  </code></pre>