Skip to main content
Participant
June 21, 2007
Question

Making a Submit button do 2 things

  • June 21, 2007
  • 1 reply
  • 335 views
I have a simple asp page that inserts a new record into an Access db. I used Dreamweaver's insert record wizard to create it and it works fine.

When the user clicks the "submit" button that actually inserts the record into the database, I'd like to have it also automatically send an email to someone notifying them that a new record has been added. I'd be content with it just having a sentence in the subject line, with nothing in the message area.

Can it be done? If so, how?
This topic has been closed for replies.

1 reply

Inspiring
June 22, 2007
It is fairly easy. All you need to do is grab some email code and insert it
in the insert code just above where it does the response.redirect to go to
your success page.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"jwcrosby" <webforumsuser@macromedia.com> wrote in message
news:f5euiq$fj7$1@forums.macromedia.com...
>I have a simple asp page that inserts a new record into an Access db. I
>used
> Dreamweaver's insert record wizard to create it and it works fine.
>
> When the user clicks the "submit" button that actually inserts the record
> into
> the database, I'd like to have it also automatically send an email to
> someone
> notifying them that a new record has been added. I'd be content with it
> just
> having a sentence in the subject line, with nothing in the message area.
>
> Can it be done? If so, how?
>


jwcrosbyAuthor
Participant
June 22, 2007
I'm sorry, Paul, but I don't know where to "grab some email code" or even what it might look like. Here is the snippet of code for the response.redirect. Could you show me where to insert the code you mentioned and I'll at least know that much. I'll look for the "email code" elsewhere unless it's something easily you'd care to share.

Dim MM_editRedirectUrl
MM_editRedirectUrl = "index.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)

Thanks.

Jerry