Results 1 to 3 of 3

Thread: Form Question

  1. #1
    Join Date
    Jan 2003
    Location
    Georgia
    Posts
    9

    Question Unanswered: 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 13:12.

  2. #2
    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.

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •