August 22, 200421 yr Hi, I'm glad that FM7 now includes bcc emailing, which means that I can now use it to email our students without making their email addresses public. The only problem is that not all students have given us their email addresses, and I've found that if there are some blank email address fields the send mail script won't work. Is there some way of getting the script to ignore the blank fields? Thanks
August 23, 200421 yr in your script add an If Statement around the email sending section of the script to see if the email address is not empty. If it is it will not try to send the email and will go to the next record Go To Record Request [First] Loop If Not IsEmpty (your email address field) ## Perform your send mail here End If Go To Record [next, exit after last] End Loop This assumes you are looping through the found set of records
August 23, 200421 yr Author Thanks for that - it worked great. (Anyone who is trying this looping method, remember to make sure that the checkbox in the specify send mail script to send the email to all found set is not checked otherwise it won't work if there is a blank record or it wil send multiple emails to everyone in the set. How could I do this without the looping, if I just wanted to send one standard email to the found set, but still ignore the blank fields?
August 23, 200421 yr One way would be to create a list of the email addresses in a global field with the correct seperator between each address (obviously dependant on your email app) To do this you would need a global text field (lets call it gHoldEmails) and also to create a layout with just the email address on. Then in your script; Go To Layout [Email address only] Copy all records Go To Layout [a layout with the gHoldEmails global field on it] Paste [select entire contents tableref::gHoldEmails] Set Field [ Substitute (tableref::gHoldEmails; ["
Create an account or sign in to comment