could any one tell me how we add a attachment in form and send in mail that attached file
could any one tell me how we add a attachment in form and send in mail that attached file
change form header like this
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'user-form',
'enableAjaxValidation'=>false,
'htmlOptions'=>array('enctype'=>'multipart/form-data'),
)); ?>
Then
<?php echo CHtml::activeFileField($model,'image'); ?>
in controller
if(isset($_POST['UserDetails']))
{
$model->attributes=$_POST['UserDetails'];
$model->photo=CUploadedFile::getInstance($model,'image');
if($model->save())
{
$model->photo->saveAs($_SERVER['DOCUMENT_ROOT'].Yii::app()->request->baseUrl.'/uploads/'.$model->image->name);
}.
.
.
.
.
.
.
.