Forum Moderators: phranque

Message Too Old, No Replies

Send email when field changes

Send email when field changes

         

bmatth1

11:00 pm on Sep 29, 2003 (gmt 0)

10+ Year Member



I have set up a form that updates a database. I would like to be notified, by email, when any of the fields change (updated by a user). Is there a way to do this? I am using ASP-VBSCRIPT, and Javascript.
thanks,
Bob

TGecho

12:06 am on Sep 30, 2003 (gmt 0)

10+ Year Member



I would think you'd want to integrate the sending of the email into whatever code you use to update your database. If you're not afraid to muck around with your script, I'm sure you can find info on sending emails with ASP.

bmatth1

12:27 am on Sep 30, 2003 (gmt 0)

10+ Year Member



I have used the method="post" action="mailto:email@address" and this kind of works. However, is there a way to suppress the box that appears asking if it is ok to send the email? I would like for this action to be behind the scenes. I am hoping someone has done this already.
thanks,
Bob

TGecho

2:54 am on Sep 30, 2003 (gmt 0)

10+ Year Member



That's probably not the best way to do it. I meant to embed a function in your asp script that sends an email. If you don't have access to your script, or can't/don't want to modify it, I don't know what you should do.

bmatth1

10:10 am on Sep 30, 2003 (gmt 0)

10+ Year Member



I don't mind modifying my code at all. Are you referring to ASPMail or CDO? Do you have a sample code that works?

shasan

2:34 am on Oct 1, 2003 (gmt 0)

10+ Year Member



<edit> nevermind :) </edit>

TGecho

2:49 am on Oct 1, 2003 (gmt 0)

10+ Year Member



try hotscripts.com and google
I don't speak asp :)

bmatth1

2:50 am on Oct 1, 2003 (gmt 0)

10+ Year Member



I am using Win XP PRO, and Cdosys.dll, and cdo.dll are on my computer in the system directory. From what I have read, Cdo can be used with Win Xp if I have these two dll files. Does anyone know of a way to run CDO with WIN Xp? I am using ASP VBSCRIPT in my web pages.
Thanks,
Bob

webboy1

8:19 pm on Oct 2, 2003 (gmt 0)

10+ Year Member



Hi bmatth1,

If you are still looking for some sample script i can help.

I actually have a few web pages running doing exactly what you want to do.

One is a registration form.....as soon as another person registers, i get an email. Its quite simple.

If you want i can send the script to you in a sticky email.

Still need it?

Webboy

bmatth1

10:04 pm on Oct 2, 2003 (gmt 0)

10+ Year Member



Hi Webboy,

Thank you for the offer. I found a copy of cdonts.dll, and registered on my winXP pro. The server that my site is hosted on uses cdonts also. I haven't had a chance to test it yet, but I plan to do so this evening. I believe that cdonts will do the job. I am always interested in script ideas. If you don't mind, please do send it to me. I will let you know how cdonts pans out.
Thank you for the gracious offer to help,
Bob

bmatth1

12:16 am on Oct 3, 2003 (gmt 0)

10+ Year Member



Well, the form seems to work ok, no errors. However, I do not receive anything when the form is submitted. Here is my cdonts code:

If Request.Form("Submit") <> "" Then
Const ws_Subject = "Results From Contact Form - Wood Moulding For Sale"
Const ws_ToEmail = "email@something.com"
Const ws_Redir = "Contact_thank_you.asp"
Dim ws_From
ws_From = Request.Form("Email_Address")
Dim ws_Body, ws_fieldName, ws_fieldValue, ws_i
For ws_i = 1 to Request.Form.Count
ws_fieldName = Replace(Request.Form.Key(ws_i),"_"," ")
ws_fieldValue = Request.Form.Item(ws_i)
ws_Body = ws_Body & ws_fieldName & ": " & ws_fieldValue & VbCrLf
Next

Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
'objCDO.From = ws_From
objCDO.To = ws_ToEmail
objCDO.Subject = ws_Subject
objCDO.Body = ws_Body
objCDO.Send()
Set objCDO = Nothing
Response.Redirect(ws_Redir)

End If
%>

Does anyone have any ideas why this is not working. I installed a copy of cdonts.dll into my windows/system32 directory, and registered in WinXp. SMTP is installed also. this seems to work, only I am not receiving any emails - IIS 5.1, and Win Xp.
Thanks,
Bob

bmatth1

1:05 am on Oct 3, 2003 (gmt 0)

10+ Year Member



Nevermind.

Thank you all who took the time to look at this code. However, I found the problem to be an operator error (MINE). I was not entering the "from" email address when I submitted the form (I will make a default), and the email was being rejected by my email screener - not a valid email address in the "from".
thanks everyone,
Bob