Hi… I got following error when i am using yii-simple-mailer. I don’t know how to solve this?
I have done There are two way to connect this mailer,
- add following in components,
‘mailer’ => array(
// for smtp
'class' => 'ext.mailer.SmtpMailer',
'server' => 'smtp.163.com',
'port' => '25',
'username' => 'your username',
'password' => 'your password',
// for php mail
'class' => 'ext.mailer.PhpMailer',
),
- after that i add this Yii::app()->mailer->send($to, $subject, $content); in my page.
But i got following error
<h1>CException</h1>
<p>Property “CWebApplication.mailer” is not defined. (/var/www/kg/yii/framework/base/CComponent.php:130)</p><pre>#0 /var/www/kg/yii/framework/base/CModule.php(105): CComponent->__get(‘mailer’)
#1 /var/www/kg/kgcp/protected/controllers/SiteController.php(248): CModule->__get(‘mailer’)
#2 /var/www/kg/yii/framework/web/actions/CInlineAction.php(49): SiteController->actionContact()
#3 /var/www/kg/yii/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#4 /var/www/kg/yii/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#5 /var/www/kg/yii/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#6 /var/www/kg/yii/framework/web/CWebApplication.php(282): CController->run(‘Contact’)
#7 /var/www/kg/yii/framework/web/CWebApplication.php(141): CWebApplication->runController(‘site/Contact’)
#8 /var/www/kg/yii/framework/base/CApplication.php(184): CWebApplication->processRequest()
#9 /var/www/kg/kgcp/index.php(28): CApplication->run()
#10 {main}</pre>