Sending Email In Yiiframework Using Yii-Mail Extensions

this is my config/main.php file

‘mail’ => array(

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









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

'logging' => true,

'dryRun' => false


this is Controller file

$message = new YiiMailMessage;

     $message->setBody('<p>hello how are you haaa</p>' , 'text/html');

   $message->subject = 'My Subject';


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


I am getting an error fsockopen() [<a href=‘function.fsockopen’>function.fsockopen</a>]: unable to connect to ssl:// (Unable to find the socket transport &quot;ssl&quot; - did you forget to enable it when you configured PHP?)

how to config the file and to active SMTP menu from your account

thanking you

I believe in case of secure layer the host name should be:


Also - double check you have ‘php_openssl’ extension enabled in your server configuration.