by John Mark Osborne, <jmo@best.com>, http://www.best.com/~jmo
Mass Mail
Putting the new Send Mail script step to work
BONUS: EMAIL.FP3
The new FileMaker Pro 4.0 script command, Send Mail, offers many possibilities such as the ability to send form emails or mass email. Mass email differs from bulk email in that an individual email message is generated for each recipient. Bulk email sends a single email to all the recipients usually by blind carbon copying everyone (BCC). The disadvantage of bulk email is that you can't personalize the message. For instance, you could attach the first name of the person at the beginning of the email while leaving the rest of the message the same for each recipient.
The script for sending a mass email is simple (much easier than using previous AppleScript solutions to accomplish the same task). All that is needed is a looping script that cycles through all the records in the found set:
Go to Record/Request/Page [First]
Loop
Send Mail [No dialog, "Subject"]
Go to Record/Request/Page [Exit after last, Next]
End Loop
Don't forget to check the option for "performing without dialog" on the Send Mail script step or your email program will not send the message the next time a scheduled connection occurs. Instead, the messages will stay open waiting for you to queue them.
The more difficult part of mass email is setting up your system software to work with the Send Mail script steps and assembling the calculations to create the form letters.
Macintosh computers require Claris Emailer, Eudora Light or Eudora Pro as well as Internet Config 1.1.1 or later. Internet Config 1.4 is the most recent version and can be downloaded from the following sites:
Claris
<ftp://ftp.claris.com/pub/USA-Macintosh/x.Shareware-Freeware/>
Shareware.Com
<http://www.shareware.com/>
Hyperarchives <http://hyperarchive.lcs.mit.edu/HyperArchive.html>
Once you have downloaded Internet Config, you will need to configure it to handle mailto protocols. If you already have Internet Config installed and your web browser is set as the helper application for the mailto protocol then you will need to change it to Claris Emailer or Eudora.
Windows users will need a MAPI compliant email program in order to use the Send Mail script step. If you already have Microsoft Exchange like most users of Windows 95 then you are ready to go.
In your WIN.INI file, you will also need the following entry in the [Mail] section:
MAPI - I
If your system is not properly configured then FileMaker will not generate an error. The Send Mail script step will execute but nothing will happen.
Another consideration when troubleshooting is a known bug documented in the Read Me file for FileMaker Pro 4.0. Here is the information as it appears in the read me:
As detailed in Microsoft Knowledge Base article number Q157005 (available at http://www.microsoft.com/kb/), sending mail from a MAPI-enabled application (such as FileMaker Pro 4.0) with a Cc: recipient may generate an invalid page fault or general protection fault in module MAPI32.DLL. According to Microsoft, this is a problem in Microsoft Exchange Server version 4.0, and has been corrected in the latest Microsoft Exchange Service Pack. For information on obtaining this service pack, please refer to the Microsoft Knowledge Base (at http://www.microsoft.com/kb/).
Claris has reproduced this problem in configurations that do not have a Microsoft Exchange server. If you experience crashes using the Send Mail script step, do not include Cc: recipients in any ScriptMaker Send Mail script steps.
Once you have your system working properly with the Send Mail script step, you can concentrate on producing a mass emailing database solution. The first step is to define a global text field for each static piece of information you need to send. Static information would be the part of the form email that does not change from email to email. A good example would be the body of the message or the subject. These pieces of information will not change from email to email. Dynamic information or text that changes from email to email is best contained in a regular text field. These fields include the email address and name.
Once these fields have been created, all you need to do is create a few calculation fields. The most common calculation will be the one that concatenates the first name field at the top of the body of the email message. The following formula comes from the bonus file included with this article:
First Name & ":^^" & Message & "^^" & Signature
^ denote carriage returns
This concept could even be used to add personalized information to the subject of an email so recipients are more likely to read it. Here at ISO, a bulk and mass email application called Email Xpress <http://www.iso-ezine.com/emx/> is used to send out invoices where the product price is included in the middle of the body of text.
One last thing to note about sending email is that the Send Mail script step will accept four different email formats:
John Mark Osborne <jmo@best.com>
"John Mark Osborne" <jmo@best.com>
(John Mark Osborne) jmo@best.com
John Mark Osborne (jmo@best.com)
The bonus file accompanying this article uses a calculation to format the email address in each of these four styles.
One thing to remember when wielding this new found power is to not get carried away. If you send 8,000 emails in one sitting, your Internet Service Provider (ISP) is bound to get mad and possibly cut off your service. If you are going to spam, then make sure you send out your emails in small subsets of a couple hundred or less.
## END ##