CDO/CDONTS do not support renaming attachments, there is only one argument
relevant here (path/filename). The two other arguments deal with embedded
messages. Also, if you are using CDONTS, I strongly recommend you migrate
your code to use CDO.Message (see
http://www.aspfaq.com/2026).
Some of the other mail objects might support renaming, or to continue using
CDO, just create a unique folder name, copy the file there using FSO, rename
it to the original name, attach that, then delete it.
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Chris Kennedy" <no****@microsoft.com> wrote in message
news:O4**************@TK2MSFTNGP12.phx.gbl...
I have a web application which saves files to a server and emails the file
as an attachment. I generate a unique name for each file by concatenating
a unique numeric string so the file name is unique and cannot be
accidentally be overwritten. I also store the original name of the file. Is there any
way to rename the attachment when I send it so it doesn't have the unique name
but rather the orignal one.