title: Loading a custom Yii Component
body: <p>I am trying to use a custom class I have created to send out mail so I can keep the controller files thin. I created my custom class and put it in the components folder. I then added:</p>
  
  <pre><code>'sendMail' =&gt; array(
      'class'=&gt;'application.components.SendMail.',
  ), 
  </code></pre>
  
  <p>underneath main components in my main config file.</p>
  
  <p>This should allow me to access the class directly correct? I try using: </p>
  
  <pre><code>Yii::app()-&gt;SendMail-&gt;MailerConfirmation();
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>Yii:app()-&gt;MailerConfirmation();
  </code></pre>
  
  <p>and all I end up with is errors.</p>
  
  <p>Can anyone tell me how I include a custom component? Maybe I am doing this all wrong?</p>