HTML Emails from FileMaker with multiple attachments

About Author

Siroos Jafary

Siroos is an experienced FileMaker Developer who have been successfully helping his clients with business automation and building custom apps. He offers best-fit solutions by combining native FileMaker techniques with modular programming methods, API integration, HTML and CSS, JavaScript, SQL, etc. His enthusiasm in learning and challenging his skills, helped him to be always up to date with new technologies in the industry. He is an active participant in FileMaker online forums to help other folks as best as he can while learning from them at the same time.


Şemsi Saracoğlu

June 6, 2018 at 1:32 pm

Thank you for this excellent file.

    Siroos Jafary

    June 6, 2018 at 1:37 pm

    You are more than welcome, Good luck!

Santosh Singh Solanki

June 16, 2018 at 7:46 am

Friend Siropa Jafaru,
I have some queries regarding your amazing application HTML Attachment Email. I have post reply of your valuable answer input new custom function. Hope you might have been go through it. Aspecting new valuable reply from your side.

    Siroos Jafary

    June 17, 2018 at 12:40 pm


    Sorry for late reply.

    1- The email signature image has to be served on a server. It can not be stored in a container field.

    2- To support multiple attachments, we are using BaseElments Plugin. This plugin uses true system path and not FileMaker path to attach files. The $PATH variable you used is a FileMaker path and will not work with BaseElements. You have two options to generate a true system path, either using custom functions which are provided with a sample file from to generate true system paths or generate it using native FileMaker functions.

    If you decide to generate the path using FileMaker native functions, please read below page to understand its basics:

    Notes about File Paths – BaseElements Plugin Help Centre

FMS WhistleBlower and HTML Email in FileMaker! – FileMakerProGurus

June 26, 2018 at 9:39 am


June 30, 2018 at 7:00 am

Hi there,

I think you file is a great job and help.
Unfortunately i am not able to make it run.
My email provider uses the port 587 with TLS encryption.
Any idea ?

    Siroos Jafary

    July 3, 2018 at 8:08 am

    Hi Philou,

    Sorry for late reply. It was a long weekend here and I was away 😉

    Try using 465 instead of 587. It seems that using 587 would return an error (I believe error number 35). It Could be certificates error (file formats, paths, permissions), passwords, and others.

Arie Husid

July 17, 2018 at 6:10 pm

Thanks for sharing this great job. It was amazing. I could make it work locally without problems, but when I tried to use it trough PSOS, occurs an number 6 error.
I test it with Mac and Windows Server (FM Server 16).
It happened to you? Any idea?.
Thanks again

    Siroos Jafary

    July 20, 2018 at 10:26 am

    Hi Arie,

    I never had that issue on servers which I tested this file on. It is a bit difficult to debug with minimum information you provided. As a shoot in a dark, I would suggest you to run a test on a FileMaker server that uses IP address instead of domain name. If that did not help, you would debug the script using BE error functions.

    Good luck!

    Siroos Jafary

    September 13, 2019 at 1:45 pm

    Hi Arie,

    Please accept my apologies for not getting back to you. Your messaged ended up in my spams folders by a mistake. The error 6 is related to FileMaker not having correct access privileges to the files. I am guessing you uploaded the file onto your server by copying and pasting it under databases folder of FileMaker server. If that is the case, please make sure that FileMaker has both read and write access to the file.

    Have you tried uploading the file to your FileMaker server using FileMaker pro?

Rudy Folden

November 10, 2018 at 2:31 pm

I was able to use Gmail SMTP but not on my organization’s server. I get back error 64.
Do you know what that means?

Also, do you know how I can set PLAIN Text authentication?

Julie Krier

April 4, 2019 at 1:53 pm

Thank you!! This post helped alot!! Still working on getting images included in the emails.

    Siroos Jafary

    April 4, 2019 at 2:04 pm

    Glad that could help! Let me know if I can help in any case.


August 9, 2020 at 5:07 pm


Thank you very much for sharing an excellent demo!

Have you considered a GMail API version, which would not require any plugins?


I have just integrated the Seedcode demo into a CRM app and can confirm that it works very well.

    Siroos Jafary

    August 14, 2020 at 11:17 am


    Thanks for sharing your smart solution. Worth to mention that since release of FileMaker 18, the “Insert From URL” script step supports protocols like HTTP(S), FTP(S), FILE, SMB, LDAP(S), and SMTP(S). Using this step, you can send out HTML emails using native FileMaker script steps.

    The solution we discussed here on this post and the solution you offered maybe still helpful to those who are still using older versions of FileMaker.


September 20, 2020 at 1:33 am


It appears there is a minor bug. When sending emails with an attachment to multiple recipients, only the first recipient receives the attachment.

    Siroos Jafary

    September 22, 2020 at 1:18 pm


    Thanks for your feedback. Good catch!

    Once BE_SMTPSend is done it clears out the list of stored attachments regardless of the success of the Send. Therefore, we need to re-attach the attachments for every recipient. I modified the file to accommodate that.

Leave a Reply

Show Buttons
Hide Buttons