Email Attachment

  • Thread starter Thread starter peter x
  • Start date Start date
P

peter x

Hi Guyz,

I'm trying to write a simple email proggie in asp.net which allows users to
send attachments. I have no problems doing the email side of things but I
want the user to be able to upload the files they wish to use as
attachments. My current approach is:

1) Retrieve file attachments using Request.Files[n]
2) Call the HttpPostedFile.SaveAs(path) to store the file locally
3) Construct the MailMessage and add the saved files as MailAttachments
4) Call SmtpMail.Send(mailMessage)
5) Delete the uploaded files

Rather than save the uploaded files to the hard-drive, is there any way I
can create a MailAttachment directly from the HttpPostedFile?

Thanks for your help,

Peter
 
peter x said:
Rather than save the uploaded files to the hard-drive, is there any way I
can create a MailAttachment directly from the HttpPostedFile?

I dont think Web.Mail can do that - Im not positive though.

Indy definitely can, it supports attachments from memory.

www.indyproject.org

Its free.
 

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

Back
Top