Email Attachment

Discussion in 'ASP .Net' started by peter x, Mar 3, 2004.

  1. peter x

    peter x Guest

    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, Mar 3, 2004
    #1
    1. Advertising

  2. "peter x" <> wrote in news:eyorroWAEHA.220
    @TK2MSFTNGP09.phx.gbl:
    > 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.


    --
    Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
    "Programming is an art form that fights back"
     
    Chad Z. Hower aka Kudzu, Mar 3, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Lenz
    Replies:
    0
    Views:
    539
    Matthew Lenz
    Feb 22, 2005
  2. steven shingler

    Email attachment from InputStream?

    steven shingler, Jan 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    403
    Shiv Kumar
    Jan 20, 2004
  3. Sam
    Replies:
    1
    Views:
    439
  4. =?Utf-8?B?U2liQW5kZWxh?=

    uploaded file as attachment to email generate on server

    =?Utf-8?B?U2liQW5kZWxh?=, Jul 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    389
    =?Utf-8?B?U2liQW5kZWxh?=
    Jul 29, 2004
  5. ecureuil
    Replies:
    0
    Views:
    357
    ecureuil
    May 28, 2006
Loading...

Share This Page