sheraz.s
(Sheraz S)
1
Hi, i am using YiiMail extension to send emails.
I have got this error when i install the extenison in my project.
Property "CWebApplication.mail" is not defined.
here is the configuration.
main.php in protected/confing
‘import’=>array(
'application.models.*',
'application.components.*',
'ext.yii-mail.YiiMailMessage'
),
‘mail’ => array(
'class' => 'ext.yii-mail.YiiMail',
'transportType'=>'smtp',
'transportOptions'=>array(
'host'=>'<host>',
'username'=>'<username>',
'password'=>'<password>',
'port'=>'25',
),
'viewPath' => 'application.views.my_emails',
),
controller function
public function SendMail()
{
$message = new YiiMailMessage;
$message->setBody('Message content here with HTML', 'text/html');
$message->subject = 'My Subject';
$message->addTo('test@abc.com');
$message->from = "test@abc.com";//Yii::app()->params['adminEmail'];
if(Yii::app()->mail->send($message) )
echo 'mail sent';
else
echo 'error while sending email';
}
please guide me where i have done mistake?
what values you specifying for host, username and password?
‘mail’ => array(
‘class’ => ‘ext.yii-mail.YiiMail’,
‘transportType’=>‘smtp’,
‘transportOptions’=>array(
‘host’=>’<host>’,
‘username’=>’<username>’,
‘password’=>’<password>’,
‘port’=>‘25’,
),
is the same values specified in php.ini or sendmail.conf file?
sheraz.s
(Sheraz S)
3
same values as specified in php.ini
fburhan89
(Sefburhan)
4
check spelling , letter cases, i had the same problem and letter i realize by going through one by one!
Latha
(Lparameshwarappa)
5
specify your mail=> inside components=>array(
mail=>array(