I have gone through all the forums for email. Here is my problem.
I have a two tables
_Master Flight Data and _Users
When a record is added to _Master Flight Data I would like an email sent to everyone from my _Users table field name UserEmail
I've tried several dirfferent codes on the the Before Record Added on the Add page and none them work can you please show me the code on how to do this. I would all the New Data to be sent in the email. Here is what I currently have for code and nothing happens.
Dim keys
message =""
keys = dict.keys
For n = 0 To dict.Count-1
message = message & keys(n) & " : " & dict(keys(n)) & vbcrlf
Next
str = "select UserEmail from _Users"
Set rsTemp = server.CreateObject("ADODB.Recordset")
rsTemp.open str, dbConnection
all_emails = ""
while not rsTemp.eof
all_emails = all_emails & rsTemp("UserEmail") & ", "
rsTemp.movenext
wend
all_emails = Left(all_emails,len(all_emails)-2)
subject="New data record"
sendmail email, subject, message
BeforeAdd = True