Snix,
The problem is, the server put's it into a tmp file even in the form value until it knows where to put, at which it then recognizes it as the correct name. The way to dynamically get that name is to first upload it to a directory using CFFILE, then you can dynamically get it's name using CFFILE.ServerFile and the direcory where you uploaded it to CFFILE.ServerDirectory. Using these variables you can then upload the file, attatch it to the email, send the email, and delete the file.
The script below would work anywhere on a server running ColdFusion. All you would need to do is change the FORM and/or the CFMAIL settings (accept for the MIMEATTACH property).
[COLOR=000080][COLOR=FF8000]<form action="test.cfm" method="post" ENCTYPE="multipart/form-data">[/color][/color]
[COLOR=000080][COLOR=FF8000]<input TYPE="File" name="attatchment">[/color][/color][COLOR=000080]<BR>[/color]
[COLOR=000080][COLOR=FF8000]<input type="Submit" VALUE="Send Email">[/color][/color]
[COLOR=000080][COLOR=FF8000]</form>[/color][/color]
<CFSET thisPath= ExpandPath("*.*")>
<CFSET thisDirectory= GetDirectoryFromPath(thisPath)>
<CFIF IsDefined("FORM.attatchment")>
<CFTRY>
[COLOR=666666]<!--- Upoad File --->[/color]
<CFFILE ACTION="UPLOAD"
FILEFIELD="FORM.attatchment"
DESTINATION="#thisDirectory#"
NAMECONFLICT="Overwrite">
[COLOR=666666]<!--- Send Email --->[/color]
<CFMAIL FROM="from@email.com" TO="to@email.com"
SUBJECT="This is a test"
MIMEATTACH="#CFFILE.ServerDirectory#\#CFFILE.ServerFile#">
Take a look at this attatchment.
</CFMAIL>
[COLOR=666666]<!--- Delete Attatchment --->[/color]
<CFFILE ACTION="DELETE"
FILE="#CFFILE.ServerDirectory#\#CFFILE.ServerFile#">
[COLOR=666666]<!--- Catch error, if it's not a jpg or gif file --->[/color]
<CFCATCH TYPE="Any">
You have encountered an error sending this email, please try it again.
</CFCATCH>
</CFTRY>
</CFIF> - tleish