using codeigniter 1.5.2
framework,i try to upload file send as an attachment in mail but when mail send it shows .dat file and not relevant to file I send.
$attachfilepath = $_FILES['userfile']['tmp_name'];
$attachfilename = $_FILES['userfile']['name'];
$CI->load->library('email');
$CI->email->from($adminemail, 'Client Name');
$CI->email->to($to);
$CI->email->subject($subject);
$CI->email->message($message);
$CI->email->attach($attachfilepath,$attachfilename);
$CI->email->send();
P.S- i heard this versions attachment function is not stable but attachment function is working when give local file
@bhugy I think this is some bus of the codeigniter version.
we cant use temp file save path in this version of codeigniter.but we can use this logic when we use pure php. (may be new version of codeigniter)