Sending Attachment in a email

Discussion in 'C#' started by rsk_beckon, Sep 9, 2009.

  1. #1
    Dear All

    I am trying to attach a file and send it to email. Developing a web page in which user have to attach a file(.doc) using browse button from his local hard disk and when send button pressed, the email with the attachment should be sent to our mailID. This is my requirement.How it is possible in classic asp.Is there is any easy way. Whether the file which the user attaching should be uploaded to server?How to upload a single file to the server?How the source file and destination folder should be mentioned in the script?
    Please assist me. Its urgent.

    Regards
    Sasikumar
     
    rsk_beckon, Sep 9, 2009 IP
  2. Link.ezer.com

    Link.ezer.com Peon

    Messages:
    647
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #2
    here a CDO way
    objMessage.AddAttachment

    <%
    Dim objMessage
    Set objMessage = CreateObject("CDO.Message")
    objMessage.To = "to@---.com"
    objMessage.From = "from@---.com"
    objMessage.Bcc = "Bcc@---.com"
    objMessage.Cc = "Cc@---.com"
    objMessage.Subject = "Subject"
    objMessage.AddAttachment "c:\a-file.txt"
    objMessage.send
    'free up the the computer memory
    Set objMessage = Nothing
    %>

    from
    http://3w.ezer.com/asp/email/cdo.message.asp#example_code

    hope this helps you
     
    Link.ezer.com, Sep 9, 2009 IP
  3. rsk_beckon

    rsk_beckon Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hai dear

    I have tried this "AddAttachment" but it is showing error that "the file is not specified". I think we have to upload the attach file to the server and after that attach the file.Kindly check at your end and please reply.

    Regards
    Sasikumar
     
    rsk_beckon, Sep 9, 2009 IP