i am developing an application for student degrees.
if a student got a low degree, i need to send an email to the director to notify him about this issue, while working in the entering value form.
but nothing happen, no message is sent,
in my view, there is a simple form to enter the student degree
when i press the submit button, there is some calculation, and based in the result a message must be sent.
the code related to the sending message is in the controller only.
this is my code
in my assignment controller:
public function actionCreate(){
...
$model->attributes=$_POST['Assignment'];
if($model->save()) {
$mail = new YiiMailer();
//$mail->clearLayout();//if layout is already set in config
$mail->setFrom('rasha-rifai@hotmail.com', 'John Doe');
$mail->setTo(Yii::app()->params['adminEmail']);
$mail->setSubject('Mail subject');
$mail->setBody('Simple message');
//send
if ($mail->send()) {var_dump($stAssignNB); //this value appeared which mean that the mail must be sent
//Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.');
} else {
Yii::app()->user->setFlash('error','Error while sending email: '.$mail->getError());
}
$this->redirect(array('newupdate','id'=>$model->id));
}
}
in config main.php
'import'=>array(
'application.models.*',
'application.components.*',
'ext.YiiMailer.YiiMailer',
//'ext.YiiMailer.YiiMailMessage',
),
'mail' => array(
'application.extensions.YiiMailer.YiiMailer',
'transportType'=>'smtp',
'transportOptions'=>array(
'host'=>'smtp.hotmail.com',
'username'=>'localhost',
'password'=>'',
'port'=>'25',
),
'viewPath' => 'application.views.mail',
),
i put also the mail folder into views folder, in the layout folder i put mail.php
in the config file i put mail.config…
all the needed information to make this extension work
but nothing arrive to my inbox,
actually, there is no error message appears even in the firebug.
what is the problem