Mail Notification

Hi All

I have some problem:

  1. Uploading multiple file, how to save multiple file into one row of my table (i’m using CmultiFileUpload, but when i save it into database it always create new record with different id, what i want is saving into database with one id).

  2. When i save that file, i want all of the member got mail notification. (i’m using some extension but it wont sent any email at all)

Actually what is wrong with my code?

heres my controller code for saving file:

public function actionCreateNagoya()


$model=new Content;

    // Uncomment the following line if AJAX validation is needed

// $this->performAjaxValidation($model);

$images = CUploadedFile::getInstancesByName('attachment');

       if(isset($images) && count($images) > 0)    






            foreach ($images as $i=>$ii) 






            $model->attachment = $ii;               










public function afterSave( ) {

$this->sendMail( );

parent::afterSave( );


public function sendMail( ) {

$mailer = Yii::createComponent(‘application.extensions.mailer.EMailer’);



 	$mailer->SMTPAuth = true;

 	$mailer->SMTPSecure = "ssl";

 	$mailer->Host = "";

 	$mailer->Port = 465;

 	$mailer->Username = "";

 	$mailer->Password = 'mypassword';

 	$mailer->From = "";

 	$mailer->FromName = "Portal Admin";


 	$mailer->Subject = "Notification.";

 	$mailer->Body = "There's Some Data Have Been Uploaded.";



      	echo "Fail to send your message!";




      echo "Message sent successfully!";



Would you all figure whats wrong with that code

[color="#006400"]/* moved from Miscellaneous */[/color]

Could you maybe put the code in code tags?

Just select it and click the ‘<>’ button. Makes it so much easier to read. :)

That did nt work either for me… try to configure pear mail extension… It worked for me…

try these links: