Filemaker Script Sends Emails with Repeating Recipient Name

When this script is executed, it sends an email to several employees. In Outlook, only one email is received by each person (as it should be), but the TO: header contains many repetitions of the recipient's email address. I can't figure out why this happens. There is a loop in the script, but the email step is called OUTSIDE the loop. I have attached a screen print of the script, with certain details omitted for privacy.

We are sending via SMTP, on MS Exchange


emailScript.jpg
LVL 2
rvfowler2Asked:
Who is Participating?
 
webwyzsystemsConnect With a Mentor Commented:
If you have several records in a row, with JIM as the LeadData::SalesmanFullName, then your script will execute the code "Set Jims Email Body" several times in a row.
Are you setting something else in that code like the TO: field?

By looking at this script, I can conclude that the design has weaknesses in a few areas.
Much better to remove all those personal names, and deal with related records, lists, or variables instead.
When names are hardcoded into scripts, then scripts need to be reprogrammed when someone changes jobs, or a new person comes on board. This area needs to be improved.
0
 
lesouefConnect With a Mentor Commented:
there is also a feature which not very obvious which allows to send the same email to the whole foundset at once or just to the current record. If you choose 1st option and loop through all records, that will send a lot...
0
 
rvfowler2Author Commented:
Thanks, will look into this.  Just to clarify, we don't get a bunch of emails, just that it is addressed numerous times.  The Exchange Server probably has an automatic function to only send once when addressed multiple times to the same person.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
lesouefConnect With a Mentor Commented:
it seems it has this feature, I just tried on my office one.
so if you receive it several times, it is probably sent several times.
0
 
rvfowler2Author Commented:
Great tips, but they don't address our problem.  We execute the code, e.g., "Set Jims Email Body" more than once because we want to append to the body text field, but no we have not coded a TO section in the script Jims Email Body.

Also, the script is designed to only send the whole foundset once.
0
 
rvfowler2Author Commented:
We figured it out.  Though we did check the radio button "One email using data from the current record," we did not uncheck the check box "Collect addresses across found set."  Once we unchecked it, this fixed our problem of mulitiple addressees.  However, one last question.  Why is this one by default and why is it not dependent on the radio button above it?  Thank you.
0
 
rvfowler2Author Commented:
Actually, in rereading this, it seems that lesouef was probably refering to unchecking the checkbox after all.  Anyway, it worked.
0
All Courses

From novice to tech pro — start learning today.