HOWTO: Send an email w/ attachment?

S

Sam

Hi,

I want to be able to send an email w/ attachment. I have an INPUT
Type="File" HTMLControl on the page. User selects the attachment using this
control.

That's where I'm stuck. First, I want to check to see if the user selected
an attachment. If not, I shouldn't worry about declaring and dealing w/
MailAttachment.

If there is an attachment, do I have to upload the file to the server first?
Can I grab it from the client's machine and attach it directly?

All the examples I found on the net are pretty lame. They all grab the file
from the C:\ drive. That's not a real life situation.

I'd really appreciate some examples -- preferably in C#.

Thanks,

Sam
 
S

Sam

Is that the only way to do it? Do you then delete the file from the Temp
folder?

Sam

Tu-Thach said:
Sam,
I have done this in the past. What I do is upload the file to a temporary
folder on the web server. Then from there, create a mail message and add
MailAttachment.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top