Send Mail based on Form Value - Only Once!

K

Kermit Piper

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
 
P

Patrice

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...
 
C

Chris Hohmann

Kermit Piper said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,016
Latest member
TatianaCha

Latest Threads

Top