In cakephp I can send an email with an attachment and it works fine.
My issue is the attachment takes the name of the tmp_name so the user recieving thr=e email attachment will have an odd filename.
How do I change the name of the tmp_name attachment? I tried rename *doesnr work and I tried move_upload which i dont want to upload and store the file so thats no good.
This is a php issue.
echo $this->Form->input('file', array('type' => 'file'));
echo $this->Form->input('message', array('label' => 'Message' ));
echo $this->Form->submit('Send', array('name'=>'send'));
echo $this->Form->end(); ?>
$tmp=$data['Myemail']['file']['tmp_name']; //tmp_name of file after uploaded
$tmp2=$data['Myemail']['file']['name']; //name of uploaded file
rename($tmp, $tmp2); //doesnt work
$Email = new CakeEmail();
$Email->from( array('email@example.com' => 'Aptutoring'));
$Email->attachments($tmp); //I want the attachment name and not the tmp_name