Hi,
Sending mail when the record is "changed" works perfectly if I "hardcode" the email address in the pm.to value.
How do I use an EMail address obtained from a field in the grid record being updated.
function AfterUpdateRecord as v (e as p)
dim pm as P
dim ps as P
dim FirstName as c = e.datasubmitted.FirstName
dim LastName as c = e.datasubmitted.LastName
dim IDNumber as c = e.datasubmitted.IDNumber
dim EMail as c = e.datasubmitted.EMail
pm.from = "[email protected]"
pm.from_alias = "Online Entry System"
pm.to = "[email protected]" - This address must be retrieved from a field and not hardcoded
pm.cc = ""
pm.bcc = ""
pm.subject = "Competitor Information Changed: "+FirstName+","+LastName+""
pm.html_message = "<HTML>Please do Not Reply to this email<BR \><BR \>This message was generated by the GOC Online Entering System<BR \>Your Personal Information was changed on the system. PLSE verify!!!<BR \><BR \><B>First Name: </B>"+FirstName+"<BR \><B>Last Name: </B>"+LastName+"<BR \><B>IDNumber: </B>"+IDNumber+"<BR \><BR \>Thank You for Your Prompt Attention<BR \><BR \>GOC System Notificaton Services</HTML>"
IF email_smtp_open(ps,"smtp.server.co.za",587,"[email protected]","******")
email_smtp_send(pm, ps)
END IF
Email_smtp_close(ps)
end function
Sending mail when the record is "changed" works perfectly if I "hardcode" the email address in the pm.to value.
How do I use an EMail address obtained from a field in the grid record being updated.
function AfterUpdateRecord as v (e as p)
dim pm as P
dim ps as P
dim FirstName as c = e.datasubmitted.FirstName
dim LastName as c = e.datasubmitted.LastName
dim IDNumber as c = e.datasubmitted.IDNumber
dim EMail as c = e.datasubmitted.EMail
pm.from = "[email protected]"
pm.from_alias = "Online Entry System"
pm.to = "[email protected]" - This address must be retrieved from a field and not hardcoded
pm.cc = ""
pm.bcc = ""
pm.subject = "Competitor Information Changed: "+FirstName+","+LastName+""
pm.html_message = "<HTML>Please do Not Reply to this email<BR \><BR \>This message was generated by the GOC Online Entering System<BR \>Your Personal Information was changed on the system. PLSE verify!!!<BR \><BR \><B>First Name: </B>"+FirstName+"<BR \><B>Last Name: </B>"+LastName+"<BR \><B>IDNumber: </B>"+IDNumber+"<BR \><BR \>Thank You for Your Prompt Attention<BR \><BR \>GOC System Notificaton Services</HTML>"
IF email_smtp_open(ps,"smtp.server.co.za",587,"[email protected]","******")
email_smtp_send(pm, ps)
END IF
Email_smtp_close(ps)
end function
Comment