You need to have the file uploaded from the client machine to the server
before the server can attach it to the mail message. It is working for
you locally because the files are already there. "c:\test.txt" exists on
both the client (your machine) and the server (your machine).
Tasks to do:
User selects files to email and submits form
Web form uploads selected files to server (search for uploading files in
ASP.NET)
Web Form saves uploaded files to a temp directory (don't forget ASPNET
write permissions)
Web form creates email and attaches files saved in temp directory to mail
message
Web form Delivers email message with attachments
Web Form cleans up temp directory
Probably not what you were expecting.
Best of luck!
"GD" <g_**@comcast.net> wrote in
news:uE**************@TK2MSFTNGP10.phx.gbl:
Hi,
An intranet application, with a SMTP mail function that lets users to
attach files with emails by selecting files in their local computers
(through a file browser component), works perfect on my local machine.
However, after deployment to a server that has Windows 2003 Sever
installed, the mail function is able to attach the file created by the
application. However, when users attach some files selected from their
local machines, it generates an error:
Exception Details: System.Web.HttpException: Invalid mail attachment
'C:\test.txt'.
It could be some security reasons even I set the full control
permissions to the attached files.
Any ideas or solutions?
TIA.
GD