This topic is locked

CDOSYS Email

12/12/2008 11:32:08 AM
ASPRunnerPro General questions
S
sfierce author

I'm attempting to send an email after a record is updated. My site is strictly internal and requires no login/password. So instead of configuring a login page and using the advanced settings to configure the smtp settings I used the instructions listed here: http://www.asprunner.com/forums/index.php?showtopic=6409. If there is some reason I must use a login page please advise. Otherwise, here are the settings I have used in the files listed in the above link:
\include\commonfunctions.asp

Left this default setting because I'm not trying to send an html email
myMail.TextBody= message

--------------------------------------------------------

\include\dbcommon.asp

I have not included my actual settings here but these are the lines I changed within the file to meet the specifics of my ISP for smtp.
cFrom = "my email address"

cSmtpServer = "my remote smtp server"

cSmtpPort = "1125" 'the port my ISP requires - not standard

cSMTPUser = "my username"

cSMTPPassword = "my password"

--------------------------------------------------------

\include\myfile_events.asp

This code was generated by ASPRunner with exception to my email address. I have not included my actual address here.
<%

// After record updated

Sub AfterEdit(dict, oldvalues,keys,inline)

' Parameters:

' dict - Scripting.Dictionary object.

' Each field on the Edit form is represented as a 'Field name'-'Field value' pair

' oldvalues - Scripting.Dictionary object with existing data record content

'** Send email with new data ****

Dim dkeys

message ="Record Updated"

dkeys = dict.keys

For n = 0 To dict.Count-1

message = message & dkeys(n) & " : " & dict(dkeys(n)) & vbcrlf

Next

email="my email address"

subject="my email subject"

sendmail email, subject, message

End Sub ' AfterEdit

%>
I do not receive any errors when a record is updated but email is never sent.