Sending HTML Email from FileMaker

Posted by donovan 11/02/2012 at 09:36PM

It comes up time and again: "How can I send a formatted email from FileMaker?" You see, FileMaker natively supports only plain text emails; you're on your own if you want rich text or HTML. But it is possible! Here's a list of options for (nearly) painlessly sending HTML emails from FileMaker.

Apple Mail

In this scenario, FileMaker uses AppleScript to send an HTML email through the Apple Mail client on OS X. Pretty much the only requirement is that the person sending the email has an email account configured in Mail. Of course, this isn't something you can often depend on. It's also exploiting an undocumented behavior, so I would be skeptical of its dependability with future versions of Mail. Still, it's handy for its ease of implementation.

Email_with_Apple_Mail_2013-03-08.zip

EDIT 03/08/2013: Cleaned up test settings; updated ancillary custom functions.

ScriptMaster Plug-In

In this scenario, FileMaker uses an external function from the ScriptMaster plug-in to send an email. ScriptMaster provides an example function, but our demo provides an enhanced version that allows for pretty much every combination of features. You might even use it to send a plain text email with multiple attachments. (FileMaker natively support only a single attachment.) This approach gives you maximum features for relative ease of deployment. Oh, and it's free! The catch is that Java is increasingly going out of fashion these days (speaking as an OS X user), so the plug-in may run into issues on some users' machines.

Email_with_ScriptMaster_2013-03-14.zip

NOTE 3/14/13: The function provided in this example occassionally fails to send the message, encountering an error like "no object DCH for MIME type multipart/mixed." I suspect the solution might be found in threads like this one, but I no longer use ScriptMaster and have thus not pursued any resolution.

EDIT 3/14/13: Removed test addresses.

EDIT 11/06/12: Added required body tag to several tests.

EDIT 03/08/13: Updated test settings.

Web Service

In this scenario, FileMaker posts parameters to a web service that then sends the email for you. All the client needs to do is post the parameters to a web server, which is good for compatibility across various client configurations. The web service can be in any language capable of providing an API accepting GET or POST requests. We've done it using PHP and Ruby.

GET is the easiest post method for FileMaker because all you need to do is load the URL in a web viewer. That means even FileMaker Go can send HTML emails using this approach. But the biggest drawback is that there's an inherent character limit to GET requests. They're also not as commonly supported as POST. POST requests are therefore the preferred method, provided your solution is capable of sending them. In FileMaker, this requires a plug-in. Most any utility plug-in will be able to send POST requests.

You don't need to write your own web service to use this approach. You can also post to free services such as JangoMail. This approach can yield more advanced features like campaign management and analytics. It also supports GET requests, so you can run the demo on your iPhone or iPad if you wish. (The following demo requires a free JangoMail account to function.)

Email_with_Web_Service_2012-11-02.zip

Other Plug-Ins

If you don't mind spending a few dollars, consider purchasing a plug-in built specifically for email handling. It might be worth the features and time saved. I have very little experience with these plug-ins, but I've added a few to our comparison table based on their marketing materials. (My apologies for the formatting.)

EDIT 11/5/12: Also check out this handy plug-in comparison by filemaker-plugins.com.

 

Method To, From, Bcc HTML Rich Text Plain Text Edit in Client Attachments Header Support SSL iOS-Compatible IWP-Compatible Server-Side Compatible Mac-Compatible Win-Compatible Plug-In Dependent Comments
AppleScript Yes Yes No Yes Yes Yes* No Yes No No ? Yes No No  
ScriptMaster Yes Yes Yes* Yes No Yes Full* No No No Yes Yes Yes Yes Java-dependent
Web Service Yes Yes Yes* Yes No Yes Full* Yes No No Yes Yes Yes No+ Ruby/PHP on server
360Works Email Yes Yes ? Yes No Yes Full ? ? Yes Yes Yes Yes Yes  
Mailit 5 Yes Yes Yes Yes Yes Yes Full ? ? ? ? Yes Yes Yes  
SMTPit Yes Yes ? Yes Custom window Yes Partial Yes ? ? Yes Yes Yes Yes  

* Feature possible, but not supported in our demo files

+ You can post to a web server using JavaScript. (See Brian's fmGo post on using the web viewer as a JavaScript engine.) Most of our implementations, however, use an existing plug-in or something like the free BaseElements plug-in.

Caveats

Mail clients will have varying support for HTML and CSS features. See Campaign Monitor's handy reference for more detail on what many of the popular clients support.

-Donovan

Comments

Leave a comment

  1. Matt Petrowsky 3 days later:

    Great list Donovan.

    Since I’m personally a fan of ScriptMaster and Java is a dependency, I would promote the use of a Server side script and taking all the burden off any client. You have to forego immediate notice of success or failure, but this is a good way to go.

    If the only thing needed is the functionality of plain text notifications then I just posted a free video article myself about doing this in fm.

    http://www.filemakermagazine.com/videos/easy-email-notifications.html

    In case you or anyone else is interested.

    Matt

Leave a comment