how can i watch a mail folder for incoming email?

Discussion in 'ASP General' started by Nancy Drew, Nov 18, 2004.

  1. Nancy Drew

    Nancy Drew Guest

    hi all

    i want to build a trouble ticket system. i'd like to have a component
    written in vbscript watch a specific mail folder for income email (something
    like '') the system should write the sender's email
    address, time received, and message body to sql server, return a new trouble
    ticket, etc. anybody know how to set this kind of thing up?

    tks
    Nancy Drew, Nov 18, 2004
    #1
    1. Advertising

  2. Nancy Drew

    Mark Schupp Guest

    Are you using an email server such as MS Exchange? If so check the
    documentation to see if you can set up rules to run a program on receipt of
    an email.

    If not, you will need to have an email client that will periodically check
    for email and trigger your script when new mail arrives. There are probably
    some 3rd-party utilities that can do this.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Nancy Drew" <> wrote in message
    news:...
    > hi all
    >
    > i want to build a trouble ticket system. i'd like to have a component
    > written in vbscript watch a specific mail folder for income email

    (something
    > like '') the system should write the sender's email
    > address, time received, and message body to sql server, return a new

    trouble
    > ticket, etc. anybody know how to set this kind of thing up?
    >
    > tks
    >
    >
    Mark Schupp, Nov 18, 2004
    #2
    1. Advertising

  3. How is the e-mail generated? If a tool generates the e-mail, can't it also
    add an entry to a table, and the system can monitor the table?

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Nancy Drew" <> wrote in message
    news:...
    > hi all
    >
    > i want to build a trouble ticket system. i'd like to have a component
    > written in vbscript watch a specific mail folder for income email

    (something
    > like '') the system should write the sender's email
    > address, time received, and message body to sql server, return a new

    trouble
    > ticket, etc. anybody know how to set this kind of thing up?
    >
    > tks
    >
    >
    Aaron [SQL Server MVP], Nov 18, 2004
    #3
  4. "Nancy Drew" <> wrote in message
    news:...
    > i want to build a trouble ticket system. i'd like to have a component
    > written in vbscript watch a specific mail folder for income email

    (something
    > like '') the system should write the sender's email
    > address, time received, and message body to sql server, return a new

    trouble
    > ticket, etc. anybody know how to set this kind of thing up?


    Use the dropdirectory:
    http://msdn.microsoft.com/library/en-us/cdosys/html/_cdosys_dropdirectory_coclass.asp

    .... then schedule your component/script to check it every so often.
    Tom Kaminski [MVP], Nov 18, 2004
    #4
  5. Nancy Drew

    Jeff Cochran Guest

    On Thu, 18 Nov 2004 11:11:04 -0500, "Nancy Drew" <>
    wrote:

    >i want to build a trouble ticket system. i'd like to have a component
    >written in vbscript watch a specific mail folder for income email (something
    >like '') the system should write the sender's email
    >address, time received, and message body to sql server, return a new trouble
    >ticket, etc. anybody know how to set this kind of thing up?


    Exchange, internet, Microsoft's mail server or another vendor's, etc.?
    If Exchange, this is easily programmed but not an ASP issue and an
    Exchange programming group could help. If Microsoft's SMTP you could
    trigger on a mail drop folder, but also not an ASP issue.

    Jeff
    Jeff Cochran, Nov 18, 2004
    #5
  6. Nancy Drew

    Nancy Drew Guest

    the email could be from a web app, in which case i'd just copy the form
    values over to sql, or it could be sent from a stand alone email client,
    which is why i need to watch the mail folder for these messages and then
    insert into sql

    "Aaron [SQL Server MVP]" <> wrote in message
    news:...
    > How is the e-mail generated? If a tool generates the e-mail, can't it

    also
    > add an entry to a table, and the system can monitor the table?
    >
    > --
    > http://www.aspfaq.com/
    > (Reverse address to reply.)
    >
    >
    >
    >
    > "Nancy Drew" <> wrote in message
    > news:...
    > > hi all
    > >
    > > i want to build a trouble ticket system. i'd like to have a component
    > > written in vbscript watch a specific mail folder for income email

    > (something
    > > like '') the system should write the sender's

    email
    > > address, time received, and message body to sql server, return a new

    > trouble
    > > ticket, etc. anybody know how to set this kind of thing up?
    > >
    > > tks
    > >
    > >

    >
    >
    Nancy Drew, Nov 18, 2004
    #6
  7. Nancy Drew

    Nancy Drew Guest

    thanks tom. this looks like it will work, but i don't usually work with com
    objects. i've getting a permissions error. there's this passage in the link
    you sent me:

    "You cannot change the credentials used to access a folder using the CDO
    Configuration object. The current thread's security context is always used.
    If you need to change security contexts to access a particular folder on the
    network, you must change the thread's security context."

    i intend to set up the watch process as a vbs file, running under windows
    scripting host. does this mean i need to give windows scripting host
    credentials to the mail folder, or the com object itself? if the latter, how
    do i do that?

    tks again


    "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    news:uT%...
    > "Nancy Drew" <> wrote in message
    > news:...
    > > i want to build a trouble ticket system. i'd like to have a component
    > > written in vbscript watch a specific mail folder for income email

    > (something
    > > like '') the system should write the sender's

    email
    > > address, time received, and message body to sql server, return a new

    > trouble
    > > ticket, etc. anybody know how to set this kind of thing up?

    >
    > Use the dropdirectory:
    >

    http://msdn.microsoft.com/library/en-us/cdosys/html/_cdosys_dropdirectory_coclass.asp
    >
    > ... then schedule your component/script to check it every so often.
    >
    >
    Nancy Drew, Nov 18, 2004
    #7
  8. "Nancy Drew" <> wrote in message
    news:...
    > thanks tom. this looks like it will work, but i don't usually work with

    com
    > objects. i've getting a permissions error. there's this passage in the

    link
    > you sent me:
    >
    > "You cannot change the credentials used to access a folder using the CDO
    > Configuration object. The current thread's security context is always

    used.
    > If you need to change security contexts to access a particular folder on

    the
    > network, you must change the thread's security context."
    >
    > i intend to set up the watch process as a vbs file, running under windows
    > scripting host. does this mean i need to give windows scripting host
    > credentials to the mail folder, or the com object itself? if the latter,

    how
    > do i do that?


    What's generating the error? Are you using the local IIS SMTP service?
    Just run the script under the context of a user that has read/write access
    to the folders.
    Tom Kaminski [MVP], Nov 18, 2004
    #8
  9. Nancy Drew

    Nancy Drew Guest

    "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    news:...
    > "Nancy Drew" <> wrote in message
    > news:...
    > > thanks tom. this looks like it will work, but i don't usually work with

    > com
    > > objects. i've getting a permissions error. there's this passage in the

    > link
    > > you sent me:
    > >
    > > "You cannot change the credentials used to access a folder using the CDO
    > > Configuration object. The current thread's security context is always

    > used.
    > > If you need to change security contexts to access a particular folder on

    > the
    > > network, you must change the thread's security context."
    > >
    > > i intend to set up the watch process as a vbs file, running under

    windows
    > > scripting host. does this mean i need to give windows scripting host
    > > credentials to the mail folder, or the com object itself? if the latter,

    > how
    > > do i do that?

    >
    > What's generating the error? Are you using the local IIS SMTP service?
    > Just run the script under the context of a user that has read/write access
    > to the folders.


    thanks tom - i was running it as an asp page. i needed to grant IUSR read
    permsissions on the drop folder. works fine now. i'll eventually convert
    the asp into vbs and have to get our server admin to grant read perms to
    whatever account windows scripting host runs under(?)...
    Nancy Drew, Nov 18, 2004
    #9
  10. > the asp into vbs and have to get our server admin to grant read perms to
    > whatever account windows scripting host runs under(?)...


    It runs as whoever starts the script. If you double-click the VBS file, it
    runs as you. If you create a windows scheduled task, it runs as whoever is
    specified in the "Run as..." field.
    Aaron [SQL Server MVP], Nov 18, 2004
    #10
    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. davout
    Replies:
    0
    Views:
    388
    davout
    Jan 24, 2005
  2. Michael Bo
    Replies:
    3
    Views:
    451
    Michael Bo
    Feb 7, 2007
  3. Phil

    ASP and incoming mail

    Phil, Oct 9, 2003, in forum: ASP General
    Replies:
    2
    Views:
    131
    John Smith
    Oct 12, 2003
  4. David Heinemeier Hansson
    Replies:
    7
    Views:
    110
    Glenn Smith
    Mar 24, 2005
  5. George  Moschovitis
    Replies:
    1
    Views:
    97
    Franz Hartmann
    Aug 8, 2005
Loading...

Share This Page