If I wanted to send an email with new data added for the following fields, MemberID, MemberFirstName, MemberLastName, MemberAddress, MemberCity, MemberState, MemberZipCode, MemberEmail, MemberPhone, MemberType, MemberInterests, UserID, Password --- How would I modify the function BeforeAdd(dict) below.
- I would like the email to go to the MemberEmail field. with a BCC for an additional email address (eg. anyname@anywhere.com)
- I would like to add some boilerplate text in the message body (eg thank you for your registration etc etc etc.)
- I would like to add a subject to the email (eg Your New registration, etc etc etc.)
Thank you for your time in advance for this help.
bnp
Function BeforeAdd(dict)
' Parameters:
' dict - Scripting.Dictionary object.
' Each field on the Add form represented as 'Field name'-'Field value' pair
'** Send email with new data ****
' do not forget to setup email parameters like From, SMTP server etc
' on 'Security->User login settings' dialog
Dim keys
message =""
keys = dict.keys
For n = 0 To dict.Count-1
message = message & keys(n) & " : " & dict(keys(n)) & vbcrlf
Next
email="test@test.com"
subject="New data record"
sendmail email, subject, message
BeforeAdd = True
' set BeforeAdd to True if you like to proceed with adding new record
' set it to False in other case
End Function