This topic is locked

Sending e-mail with master table fields in add page of child table

3/16/2006 7:02:20 AM
ASPRunnerPro General questions
orit author

(ASPRunner version 3.2)

I'm using method published in this forum in order to send mail with the content of the new added record :

'send mail

Dim objCDOSYSCon

Set objCDOSYSMail = Server.CreateObject("CDO.Message")

Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver"); = "10.11.0.13"

objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport"); = 25

objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing"); = 2

objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"); = 60

objCDOSYSCon.Fields.Update

Set objCDOSYSMail.Configuration = objCDOSYSCon

objCDOSYSMail.From = rs("Owner")

objCDOSYSMail.To = "test@test.com"

objCDOSYSMail.Subject = "New comment #" & rs("AIR_No") & " was posted"

objCDOSYSMail.HTMLBody = "<table cellpadding=6 border=1 cellspacing=0 bordercolor=white bgcolor=efefef><tr><td><font face=arial size=2>Comment Date</td><td><font face=arial size=2>" & rs("Owner_Comment_Date") & "</td></tr><tr><td><font face=arial size=2>Comment</td><td><font face=arial size=2>" & rs("Owner_Comment") & "</td></tr></table>"
objCDOSYSMail.Send

Set objCDOSYSMail = Nothing

Set objCDOSYSCon = Nothing



The Added record is added to a child table. In the e-mail, I would like to send in the also content from the master table of this child table. how to do this?
Thanks

Sergey Kornilov admin 3/16/2006

Hi,
you can do it in the following way:

set rstemp = Server.CreateObject ("ADODB.Recordset")

rstemp.open "select * from mastertable where id=" & Session(strTableName & "_masterkey"), dbConnection
strMessage=" Field1: " & rs("Field1")



Now you can use rstemp("FieldName") to access master table field values.