"Invalid mail attachment" error from server only

G

GD

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
 
C

cbDevelopment

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top