Skip to main content
Known Participant
October 1, 2009
Answered

Delete Record and Send Email

  • October 1, 2009
  • 2 replies
  • 5046 views

I know there is somebody out there that can tell me how to do this. Here is my page http://www.gcfa.org/delete_data-3.asp. If you want to test it, type in a number from 1-10.

It will bring up a results page with the database information. This is where I need your help. Since I want to delete this record how can I send an email right before it gets deleted?

Any help is greatly appreciated. Steer me in the right direction someone please. If it won't ever happen, tell me that, just please tell me something.

This topic has been closed for replies.
Correct answer Lon_Winters

I am sorry but I not totally understanding what you mean when you say "start by outputting all of the recordset values to the screen". Do you mean, make sure they have a value in my database, or do you mean I should bind them to the textbox? I am lost, please help.


That's for troubleshooting, so yes, you would have to bind the values to a text box or just in the page somewhere.  Once you're sure each field returns a value you can remove the binding as long as you continue to test using the same record.

Brenget clarified what I stated and what you had asked about, that the email script is attempting to reference a value that is no longer present because it just got deleted.  So you have to declare variables after the recordset code, and use those variables in the email script in place of what is in there now.

If you use the departments example that I posted above to declare and populate the variable, then the email code would read:

myMail.HTMLBody= "URL: " & departments &_  ...and so on.

Just make sure you do that for each one of the variables you need to include in the body of the email.

2 replies

tlw444Author
Known Participant
October 22, 2009
Please download the attached file to view this post
Participating Frequently
October 1, 2009

If you want to send an email first, you simply insert your code that sends the email prior to the code that executes the delete statement. What exactly is your problem? Do you understand how to write code?

tlw444Author
Known Participant
October 1, 2009

Thanks for replying, and to answer your question no I don't know how to write the asp code. That is what I am asking for. This is new to me. Can you help?

Participating Frequently
October 1, 2009

OK, I guess I am unclear as to how you created what you have so far without knowing how to write code. If you are relying solely on DW server behaviors, you need to understand that they can only take you so far. Since you require something more than they provide, you are going to need to learn how to write code, or hire someone else to do it for you.

You could start by searching for 'ASP form mail' scripts. That will provide you with the code that will send emails via ASP.

And of course, without seeing your actual code, nobody is going to be able to help you online. If you want to post your existing code, someone can make some suggestions of where to insert your mail script.

But I really believe that hacking code together without understandling the fundamentals of the language is a bad approach.