E-mail notification

Posted on 2005-04-27
Last Modified: 2010-07-27

We are using forms to gather information for an event and the data is entered in an access DB. Although we created a master page which is complete data dump of the DB, we would like to get an e-mail notification that simply advise us that a client actually entered data in our DB.

In other words, once the client press submit the data is entered in DB and an e-mail is sent to us it doesn't need to have the subitted data into it, just a simple quick notification to remind us to go and create a report.

Our script are in ASP. The notification snippet could be in javascript too.

We've looked everywhere and no luck on finding it.\


Question by:Marcomnet
    LVL 30

    Expert Comment

    > We've looked everywhere and no luck on finding it.\
    Google is a good start in such cases:

    Try this result, is a good source:

    Author Comment

    Fact is we know how to create forms to e-mail, we need an notification e-mail to be sent automatically after submitting the form just to tell us that someone added info to the DB

    LVL 30

    Expert Comment

    If you can do form to database and form to e-mail, then you just need to combine both in the same asp file.

    Author Comment

    I understand...but

    My form is already performing an action as to insert data in DB, how would I go inserting a second action in this form?

       <form method="POST" action="<%=MM_editAction%>" name="form1"> this is the form tag

    How can I insert a second action?

    Thank you!

    LVL 30

    Accepted Solution

    You don't need to add a second action.
    You need to modify your action to do both saving to DB and e-mail notification.
    LVL 13

    Expert Comment

    If you are already inserting the data into database
    put the mail sending code after the insertion

    If LCase(Request.ServerVariables("REQUEST_METHOD")) = "post" Then

     ' insert to database
      SQL = "INSERT INTO ....."

         'send mail here

    End If


    Expert Comment

    Try this ...

    one you have inserted the data in the database and the insert was successful ... try the following ...

    If (insert successfull) then
    dim objEMail
    set objEMail = Server.CreateObject("CDONTS.NewMail")
    objEMail.To = [the email address you want the email to go]
    objEMail.From = [the email address from who is sending the email.  TO and FROM can be the same person]
    objEMail.subject = [subject of the email]
    objEMail.body = [the text in the email]
    objEmail.BodyFormat = 0
    objEmail.MailFormat = 0
    set objEMail = nothing
    end if

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Shoutout to Emily Plummer ( for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now