When sending emails to customers, it can often help get their attention by adding a bit of design and creativity to what could otherwise be a boring block of text. With FileMaker, you can now send HTML emails without the need for 3rd-party plugins, making upgrading FileMaker easier. Let's take a look at how to send native HTML emails using FileMaker.
How To Send
The Insert From URL script step now supports the SMTP protocol and includes a handful of SMTP cURL options. Using your SMTP server as the URL and the "--mail-from" and "--mail-rcpt" cURL options, you can specify where the email is sent from, who is sending the email, and who is receiving the email. Perhaps most importantly, you can use the "--upload-file" cURL option to upload a text file containing the HTML that you want to send.
URL smtp://<SMTP Server>:<SMTP Port> cURL --ssl<br> --mail-from "<From Email>"<br> --mail-rcpt "<To Email>"<br> --upload-file $emailBodyFile<br> --user "<SMTP Username>:<SMTP Password>"
And now that FileMaker can natively read and write files, you can use those script steps to create the HTML file for the email or you can use Base64 Encode and Decode to take the HTML and save it to a file in a container.
Inline Images
FileMaker also has the ability to create in-line images inside of the HTML text file being sent. We are already using the MIME standard, which allows us to create an HTML text file to send as an email, and utilizing the content type of multiple-part will allow us to include in-line images. We are using the Content-Type: multipart/related to define two sections of the email: the body of the HTML and the in-line image.
Once we obtain the type of the in-line image from the uploaded file, we will use base64 encoding to get text from the image, and then we can use the filename to name the image and give it a Content-ID. To include in-line images, you will also have to add the following tag to your HTML body: <img src=”” alt=””></img>. The src attribute of this tag indicates the location of the in-line image we are specifying in our HTML text file and is linked by setting src to the Content-ID of the image, i.e. <img src=”cid:image.png” alt=”image.png”></img>, which is something that is done automatically in the scripting.
After adding this to the demo file, uploading an image, creating the text file, and then sending the email, you should see your image in the body of the email!
Conclusion
FileMaker can now send HTML emails natively! By using a little scripting and some simple cURL options, you can send beautifully designed HTML emails, eliminating the need for 3rd-party products and helping you grab your customers' attention. Contact us if you would like help sending native HTML emails out of FileMaker.
Did you know we are an authorized reseller for Claris FileMaker Licensing?
Contact us to discuss upgrading your Claris FileMaker software.
Download the Sending FileMaker HTML Emails File
Please complete the form below to download your FREE FileMaker file.