You are here:

Active Server Pages Programming (ASP)/Send Mail based on Form Value - Only Once!

Advertisement


Question
Hello Srini,

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 2000 database. Any help sure would be appreciated.
Thanks in advance, BW  

Answer
hi

Sorry for the delay! i thought i replied for all my pending questions...

Okay, what you can do is store the old values into Session when user press Update button compare the values.. If the values changes send email and make a flag.. until user in that session you can prevent sending mail..

Happy Programming!

-Srini

Active Server Pages Programming (ASP)

All Answers


Answers by Expert:


Ask Experts

Volunteer


Srini Nagarajan

Expertise

I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience

Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.

©2012 About.com, a part of The New York Times Company. All rights reserved.