Send Mail based on Form Value - Only Once!

Discussion in 'ASP General' started by Kermit Piper, Oct 5, 2005.

  1. Kermit Piper

    Kermit Piper Guest

    Hello,
    I've been racking my brains over this one. I have a Classic ASP edit
    form with many fields, one of them a Status drop-down. If the Status
    (option value) has been changed to "Pending" for instance, I do a
    objMail.send, otherwise it doesn't send. No problem, but how can I
    prevent the mail from sending AGAIN if a user goes back to the page and
    updates another field, or even just refreshes the page? If it helps, I
    am updating a SQL Server database. Any help sure would be appreciated.
    Thanks in advance, KP
     
    Kermit Piper, Oct 5, 2005
    #1
    1. Advertising

  2. Kermit Piper

    Patrice Guest

    Not sure what exactly it is, but you could just keep an indicator (either a
    boolean or perhaps a date) that allows to know if a mail was sent for this
    item...

    --

    Patrice

    "Kermit Piper" <> a écrit dans le message de
    news:...
    > Hello,
    > I've been racking my brains over this one. I have a Classic ASP edit
    > form with many fields, one of them a Status drop-down. If the Status
    > (option value) has been changed to "Pending" for instance, I do a
    > objMail.send, otherwise it doesn't send. No problem, but how can I
    > prevent the mail from sending AGAIN if a user goes back to the page and
    > updates another field, or even just refreshes the page? If it helps, I
    > am updating a SQL Server database. Any help sure would be appreciated.
    > Thanks in advance, KP
    >
     
    Patrice, Oct 5, 2005
    #2
    1. Advertising

  3. "Kermit Piper" <> wrote in message
    news:...
    > Hello,
    > I've been racking my brains over this one. I have a Classic ASP edit
    > form with many fields, one of them a Status drop-down. If the Status
    > (option value) has been changed to "Pending" for instance, I do a
    > objMail.send, otherwise it doesn't send. No problem, but how can I
    > prevent the mail from sending AGAIN if a user goes back to the page and
    > updates another field, or even just refreshes the page? If it helps, I
    > am updating a SQL Server database. Any help sure would be appreciated.
    > Thanks in advance, KP
    >

    Store old_status in a hidden form field. Compare that to the new_status
    value when the form is submitted. If they're different, email.
     
    Chris Hohmann, Oct 5, 2005
    #3
    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. Nathan Sokalski
    Replies:
    3
    Views:
    1,985
    Larry Lard
    Nov 23, 2005
  2. Tatyana
    Replies:
    3
    Views:
    1,773
    Mark Rae
    Aug 7, 2006
  3. Replies:
    0
    Views:
    1,467
  4. danfolkes

    Why does the message send only once?

    danfolkes, Oct 16, 2007, in forum: Python
    Replies:
    3
    Views:
    338
    Bruno Desthuilliers
    Oct 16, 2007
  5. nauticalmac

    Mail insertion hack on Send Mail form

    nauticalmac, Dec 23, 2005, in forum: ASP General
    Replies:
    0
    Views:
    311
    nauticalmac
    Dec 23, 2005
Loading...

Share This Page