How to send email with mail extensions

Dear master yii.

i used this ext : Yii-mail

Yii-mail

my main config




 'mail' => array(

            'class' => 'ext.yii-mail.YiiMail',

            'transportType' => 'php',

//            'viewPath' => 'application.group.views.financialservices.mail',

            'logging' => true,

            'dryRun' => false,

        ),



my function in controller




 public function actionContact() {

        $this->pageTitle = 'Financial Services';

        $model = new ContactUs;


        if (isset($_POST['ContactUs'])) {

            $model->attributes = $_POST['ContactUs'];

            $model->create_by = Yii::app()->user->id;

            $model->create_at = time();

            $model->status = '0';

            $model->modul = '1';

            $model->nik = Yii::app()->user->name;


            if ($model->save()) {


                $message = new YiiMailMessage;

                //this points to the file test.php inside the view path

                $message->subject = 'My TestSubject';

                $message->setBody('text/html');

                $message->addTo('jhon@mail.co.id');

                $message->from = Yii::app()->params['adminEmail'];

                Yii::app()->mail->send($message);

                $messageType = 'success';

                $message = "<div class='alert alert-info alert-dismissable'>Successful!</div>";

                Yii::app()->user->setFlash($messageType, $message);

                $this->redirect(array('admin'));

            }

        }


        $this->render('contact', array(

            'model' => $model,

        ));

    }



no error shown but email not sent.

How to fix it.

Regards

hey :)

i’m not master but,

have you read this ? : http://www.yiiframework.com/wiki/468/send-mail-using-yiimail-extension

I’m not master either, but have you tried your code in the web server??, in localhost you may have some problems!

thanks sir. the problem has been solved :D

i used this ext smtp-mail

thanks sir. the problem has been solved :D

i used this ext smtp-mail

I think you missing transportOptions

Here is my config:


'mail' => array(

            'class' => 'ext.yii-mail.YiiMail',

            'transportType'=>'smtp', /// case sensitive!

	    'transportOptions'=>array(

					'host'=>'smtp.domainame.com',

					'username'=>'support@domainame.com',

					'password'=>'yourpassword',

					'port'=>'2525', // Your port

					

                ),

            'viewPath' => 'application.views.mail',

            'logging' => true,

            'dryRun' => false

        ),