Script - Send email
I write biomedical software for a living so programming concepts and constructs I am familiar with. I've also done a fair amount of scripting.
I have a FM V11 database for our 66 homeowner HOA that I maintain on a Mac (Snow Leopard). Each month I must send 54 emails containing a PDF of the monthly meeting minutes. I have written FM scripts to help me send out these emails. Basically the script selects a range of records (those people that have email addresses) then uses the SendMail script to send the mail.
There are several problems.
1) I don't use Mac Mail as my default email client and FM pretty much requires this if you are going to use the email client option of Send email. While this is an annoyance I can switch to Mac email and run the script. However it opens 54 email message windows that I must go through and hit send for. This works and it is nice I can see that each one is being sent. But Mac Email does not like having 54 windows open and slows down quite a bit.
2) So I tried the direct SMTP functionality. This works nice but I get zero validation that the emails have been sent and several times during its use yesterday I got an error from the script that email could not be sent. So now I was in a situation where some had sent, some not but I had no idea which. So I was forced to resend to all again. So while this is a nice thing, having it automatically do all 54 is kinda bad because you have no way to determine if all 54 were successful. When I used the SMTP feature the sent emails did not seem to be copied to my sent email folder. I think that is an email client feature so I could not use that to validate which were sent and which were not. The other problem with SMTP feature is that it disables the use of the "dialog" when sending mail. I had hoped to use that to attach a PDF file and make sure each email sent, but there is no way to turn that feature on with SMTP enabled.
So I decided perhaps that I should try finding the set of records then using a script loop to loop through the found set and perform send email one by one. I really don't care how long it takes I just need to know that it was successful for each record. When I look at the scripting commands I see looping but I do not see a way to "goto first record" , "next record" etc... Is this possible? Am I just missing it?
Basically I'm close on my solution but just have these rough edges to get around. Any help would be appreciated.
So the problems are:
a) How to insure each email is successfully sent
b) If I have to loop in a script how do I go to first, next records etc?