#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    10
    Rep Power
    0

    Finding a file within a folder hierarchy and emailing it?


    Right now we have an Access database that contains data
    pertaining to spam that has been caught by our spam
    software. The spam software places data into this
    database automatically.

    What I'm setting up is a web page that has all these
    records created by the spam software, and I would like to
    be able to have users log onto a web page, and search
    through their caught messages, and if they see one that
    is not spam, and I want them to be able to "release"
    these messages from the server.

    The database has a field that gives the .msg filename
    (EXAMPLE: B0000000273.MSG). These files are not contained
    within one folder, but rather a series of folders. The
    10,000 digit, or the 5th from the right, seems to specify
    what folder the message is placed into. See examples
    below.

    Example of folder hierarchy:

    ----------------------------------------------------------
    ----------------------

    -->QUARANTINE
    |------>0000
    --|------>B0000000273.MSG
    --|------>B0000000274.MSG
    |------>0001
    --|------>B0000015118.MSG
    --|------>B0000019243.MSG
    |------>0002
    --|------>B0000026784.MSG
    --|------>B0000028421.MSG

    ----------------------------------------------------------
    ----------------------



    So what I need is a link on my page that will somehow
    pass the "B0000000273.MSG" to an email component, which
    will search the folder "QUARANTINE" for "B0000000273.MSG"
    and if it finds it, then attach it to an email, and send
    it the recipient specified in the same record in the
    Access database.

    I have to imagine that something like this has been done
    before, since I do not consider myself a visionary, as a
    matter of fact, I think of myself as quite the opposite.

    My current page: (CAUTION: Profane language ahead)
    http://www.rdi1.com/reporting/

    Somebody please point me in the right direction, and
    remember, I'm completely new to ASP and VBscript web
    programming. I've got a bit of experience with CDONTS,
    but none with FSO, but I'll go along with whatever you
    tell me to do.


    Thanks,
    Matt
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Location
    a northern town
    Posts
    74
    Rep Power
    13
    You can check recursively through the directory tree using the FSO but it looks like you can easily predict the folder which will contain the required e-mail by checking the *nth character of the msg name. Once you have defined the folder name it shouldn't be too difficult to either attach the file to an e-mail or extract the content and send to the user using cdonts.

    This may help with the e-mail?

    HTH.
    /* measure twice, cut once */

IMN logo majestic logo threadwatch logo seochat tools logo