We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
echo $this->Form->input('file', array('type' => 'file')); echo "<BR/>"; echo $this->Form->input('message', array('label' => 'Message' )); echo $this->Form->submit('Send', array('name'=>'send')); echo $this->Form->end(); ?>
$data=$this->request->data; $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 $message=$data['Myemail']['message']; $Email = new CakeEmail(); $Email->config('gmail2'); $email@example.com'; $Email->from( array('firstname.lastname@example.org' => 'Aptutoring')); $Email->to($to); $Email->subject('Hello'); $Email->attachments($tmp); //I want the attachment name and not the tmp_name $Email->send($message);
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.