If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Form Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-10-03, 12:02
phillip_ewing phillip_ewing is offline
Registered User
 
Join Date: Jan 2003
Location: Georgia
Posts: 9
Question Form Question

This might be very basic but i do not know the answer:

Do you know how?
If a User fills out a form (like a feedback form for example), have that form go to a database, get stored, and have the admin of that database receive an e-mail saying the database has been updated.

Here's the situation. I work for a school system that basically wants on online application. I can create the database with the required fields and point them in the fields and even write to database, that's the easy part (I can handle this). What I need is some code that once the data is wrote to the database, it e-mails the recipient that a new application has been submitted. If you could get me started, I could finish it out.

My part:
<FORM NAME="frmUser" ACTION="addnewapp.asp" METHOD="POST">

and have addnewapp.asp open the database and write to required fields.

Your part:
What next? I cannot use CGI or DLL's to help me do this. So Matt's formmail.pl is out of the question.

Thank you in advance, Phillip Ewing

Last edited by phillip_ewing; 02-10-03 at 12:12.
Reply With Quote
  #2 (permalink)  
Old 02-10-03, 13:00
d_kishan d_kishan is offline
Registered User
 
Join Date: Feb 2003
Posts: 18
Re: Form Question

There are two solvations for your problem.

1. After successful insertion of the data into Database, send a mail using any mail component from ASP Script, in which u r calling the query to insert data into DB.

2. If u are using SQL Server as the database, u can a write a trigger on insertion of data for that perticular. In trigger send a mail using xp_sendmail.

Sql Server is providing a feature to mail from the database using the stored proc. xp_sendmail.
Reply With Quote
  #3 (permalink)  
Old 02-11-03, 12:21
pal19 pal19 is offline
Registered User
 
Join Date: Feb 2003
Location: @ home
Posts: 163
Re: Form Question

If you are using Microsoft SQL Server 7 or earlier, the easy way to do this is create a trigger on the table for insertion that will fire a message using the system stored procedure xp_sendmail.

If not using MS SQL Server or don't want to use triggers just made a script using for instance ... CDOnts to send the mail. See this example:

http://www.asp101.com/samples/viewas...le=email%2Easp

______________
Paulo Gonçalves
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On