Forums

This topic is locked

ASP: Sending email after insert record

Posted 25 Aug 2007 01:47:34
1
has voted
25 Aug 2007 01:47:34 Violet W posted:
I've found a couple things on this, however, none of which that describe my situation.
(note: this is not Asp.NET)

This is what happens:
Client logs in
Client goes to add a survey (insert file)
Once inserted, it goes back to the page to display the newly entered data

What needs to happen:
When Client hits submit, it inserts the record into the database, but it also needs to send an email to our client results manager (CRM).

I was using this script, but I don't even know if I can use a reference like that (In the Mail.To line) let alone where I should place it (before <head> after <body> ???). I was thinking of once the form was submited, instead of going back to that page, it would go to this "email" page where this code would be with the proper recordsets and email the CRM.

<%
Set myMail=CreateObject("CDO.Message"
myMail.Subject="Sending email with CDO"
myMail.From=" "
myMail.To="<%=(crm.Fields.Item("email".Value)%>" <--- Can I even use that??
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>

I've looked a lot of places and they all seem to have an answer for only half of what I want to do.

Much appreciated for any help anyone can provide.

Edited by - vmethod on 25 Aug 2007 01:47:55

Replies

Replied 12 Sep 2007 17:44:07
12 Sep 2007 17:44:07 Robert Cozzi replied:
I wish I was replying with an answer, but I actually need help with a similar problem. I need my form to enter data into my Access Data base and then send us an email with the form.

The form is working great, but ince I turn on the insert record capabilities they both fail, the form email and the data entry.

Do you have a solution?

Reply to this topic