After searching stackoverflow i didnt get any answer to my problem.
The problems is that i have a form with upload button so when the user submits a file that will be emailed to
Solve one problem at a time: fix your upload first, then worry about emailing it. You need to call move_uploaded_file for safety, check that it's all OK, and then try to send it. There is an example provided with PHPMailer that does exactly what you need.