Sending Email


I am trying to use this extension to send emails::

I am using Gmail as smtp server.

I tryed this conf. at main.php:

'mail' => array(

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

   'transportType' => 'php',









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

    'logging' => true,

    'dryRun' => false

and this is the controller code i am trying to use:

                $emailEnvio = New YiiMailMessage;

                $emailEnvio->view = 'emailEnvioDeArquivo';


                $emailEnvio->from = "XXXXXX@XXXXXXXX.XXX";

                $emailContato = Emailcontato::model()->findAllByAttributes(array('id_email'=>$email->id));


                    foreach($emailContato as $ec){

                        $endereco = Pagamarela::model()->findByPk($ec->id_pagamarela);

                        Yii::log($endereco->email, 'info', 'email');





I received this error:

mail() [<a href=‘function.mail’>function.mail</a>]: Failed to connect to mailserver at &quot;localhost&quot; port 25, verify your &quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set()

Help please.

You need to set the transport type to ‘smtp’ :)

‘php’ is local sendmail.

For sure!

And put this on main.php:




instend of