Trigger a script after email arrives

Discussion in 'Email' started by grotgod, Jul 25, 2014.

  1. Hi there,

    Is the following scenario possible?
    1. Based on information supplied by a user on our website, a new email address is created using the mail API
      • I have not had any reason to work with the mail API before, but this part of the scenario should not be a problem, given the clarity of the API documentation I have seen so far.
    2. When email is received by this new email address, a script on our site is launched that performs certain actions after checking that the received email is within predefined parameters.
      1. The actions performed will be based on information contained in the email (From, Subject line and Body)
    So in a nutshell:

    Email arrives --> this triggers a script ---> script reads email ---> performs actions

    Can this be done?

    I have gone through the various settings in the SmarterMail interface for the postmaster on this domain.
    There are numerous options for registering event-listeners based on email events (mail arriving, mail being sent etc), however I did not see the ability to kick-off a script directly, or execute a command line that in turn could run the script.

    [​IMG]

    Any advice will be much appreciated.

    Thank you very much.
     
    Last edited: Jul 25, 2014
  2. FrankC

    FrankC DiscountASP.NET Staff

    Unfortunately, SmarterMail doesn't have the ability to trigger a script when email comes in.

    You may want to create an app that POP the account and do your own processing.
     
  3. Thank you for the reply Frank.

    I have been trying various options along your suggested route, the easiest of which would be to simply use the POP3 functionality available in Jmail.
    Unfortunately it seems that this is unavailable at DiscountASP?

    The test page: http://key-skill.com/mailReader.asp returns:

    jmail.POP3 error '8000ffff'

    This function is not included in this version of jmail.

    /mailReader.asp, line 8



    The pertinent code is:

    Set pop3 = Server.CreateObject( "JMail.POP3" )
    pop3.Connect "username_here", "password_here", "mailbox_here"



    Other than Jmail, are there any other third-party resources available in the DiscountASP hosting environment that I would be able to use to accomplish this?

    Looking forward to your reply.

    ps: While searching around in the SmarterMail documentation I came across remarks concerning earlier versions of SmarterMail that had the native ability to trigger a command line argument based on a mailbox event. I could find no references to show that this is still supported on the currently installed version.
     
    Last edited: Jul 28, 2014
  4. FrankC

    FrankC DiscountASP.NET Staff

Share This Page