Send Email

Hi… I’m stefanus

I want to ask about anyone who have success with problem.

This is my steps which i already done :

  1. I use mail SwiftMailer wrapper extension from http://www.yiiframework.com/extension/mail

  2. This my code in config/main.php

  1. This my code on controller :

This is my first attemption to use this extension or sending email experience in php.

I’ve tried to run this, and i still get an error like this :

I tried to open YiiMailMessage.php on line 112 like above error told, this is :

Is there anyone can explain me or give me suggestion ??

Thanks a lot

Try using this Swift extension instead

http://www.yiiframework.com/extension/mail

Hi,

you should have:




'import => array(


 		'ext.mail.YiiMailMessage',

 	),



In line:




'class' => 'application.extensions.YiiMailMessage',



I think, that is missing folder with mail extension and should like




'class' => 'application.extensions.mail.YiiMail',



Doc from extension:




/**

* YiiMail is an application component used for sending email.

*

* You may configure it as below.  Check the public attributes and setter

* methods of this class for more options.

* <pre>

* return array(

* 	...

* 	'import => array(

* 		...

* 		'ext.mail.YiiMailMessage',

* 	),

* 	'components' => array(

* 		'mail' => array(

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

* 			'transportType' => 'php',

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

* 			'logging' => true,

* 			'dryRun' => false

* 		),

* 		...

* 	)

* );

* </pre>

* 

* Example usage:

* <pre>

* $message = new YiiMailMessage;

* $message->setBody('Message content here with HTML', 'text/html');

* $message->subject = 'My Subject';

* $message->addTo('johnDoe@domain.com');

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

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

* </pre>

*/