Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2004
    Posts
    75

    Unanswered: uploading file and attaching to email

    I have a form that I want the user to be able to attach a file and upload it with the form, then get the file that was up loaded and send it out as an attachment with an email. I am using CDONTS and I can get the form info to send out in an email as well as an email to the person who filled out the from, but I can not figure oout how to upload a file and then attach it to the email. Anyone out there that can help..

    Thanks

    breeze76

  2. #2
    Join Date
    Apr 2004
    Posts
    75

    Re: uploading file and attaching to email

    Originally posted by breeze76
    I have a form that I want the user to be able to attach a file and upload it with the form, then get the file that was up loaded and send it out as an attachment with an email. I am using CDONTS and I can get the form info to send out in an email as well as an email to the person who filled out the from, but I can not figure oout how to upload a file and then attach it to the email. Anyone out there that can help..

    Thanks

    breeze76
    Ok I got the upload file thing solved.. now I need to be able to attach it to the outgoing email... If the file was the same format and name I could do it, but the file or files will be differnt names and types.. so Now I need to attach to the email..

    breeze76

  3. #3
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    Don't know if this might hopefully help but www.asp101.com has some good e-mail examples in the Samples section.
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

  4. #4
    Join Date
    Apr 2004
    Posts
    75
    Originally posted by Bullschmidt
    Don't know if this might hopefully help but www.asp101.com has some good e-mail examples in the Samples section.
    Thanks but they do not have anything there that can help.. I have gotten as far as they are.. and i can attach a file if i use a static file name... but i need to be able to use a variable file name to use the file that they upload instead of a file that is already there..

    breeze76

  5. #5
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    Well in the E-mail with Attachment sample perhaps change this:

    ' Attachment using known static physical path
    .AddAttachment "c:\somepath\somefile.txt"

    To be more like this instead:

    ' Attachment using known static physical path and variable filename.
    .AddAttachment "c:\somepath\" & varMyFilename
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

  6. #6
    Join Date
    Apr 2004
    Posts
    75
    OK will give it a try, I just need to DIM my variables, correct?

    breeze76

  7. #7
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    If you have this toward the top of the page then you must Dim each variable before using it:

    <%
    Option Explicit
    %>

    And the idea here is that this is a favor to yourself so that you DO get an error if using a variable (perhaps that is a typo or something) that was not explicitly dimmed.
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •