Jump to content
Sign in to follow this  
Dave Vaklyes

Sending base64 encoded HTML

This topic is 382 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Short question - Is there a way to change the Content-Transfer-Encoding when setting the body of an email?

Back story - Every week we send an email blast to our folks which is an HTML eCard provided by our podcast provider (VoiceAmerica). We get the eCard as a text file with the HTML code, open the file and put the code into a field. We use EmailSetBody to attach the field to the email as HTML.

For almost everyone of the 11,000+ who receive the eCard it opens just fine. But for folks with a gmail.com address, who are using the Gmail web interface, or the iOS Gmail app, the body of the message does not display. Downloading the message as a .eml shows that the HTML is in the message. Open the message with any non-google email reader and the HTML shows just fine.

If VoiceAmerica sends the message, Google readers show it just fine. But VoiceAmerica is sending both the text and HTML sections with the content base64 encoded, with the header Content-Transfer-Encoding: base64.

I can get the fields base64 encoded, but how do I set the Content-Transfer-Encoding header to base64?


Edited by Dave Vaklyes

Share this post

Link to post
Share on other sites

Hi Dave,

If you need to set a header for an email you can use the function EmailSetHeader . It takes the name of the header and the value of that header as parameters. So in your case the function call would like this:



Try that and see if it resolves the issue. I would also make sure setting this header doesn't change the appearance of the email for non-gmail recipients. 

  • Like 1

Share this post

Link to post
Share on other sites

I tried the EmailSetHeader, but couldn't get it to work.

Then I had a "Doh" moment when I realized that by setting that header the plugin does the base64 encoding. 

So I removed my base64 encode, and now it still doesn't work. The value of Content-transfer-encoding is not getting set.

My code sequence is:

Set Variable [ $resultSetup ; Value: EmailConnectSMTP( "email.XXXXXXXXXXXXXX.com:465"; "server@XXXXXXXXXXXXXX.com" ; "XXXXXXXXXXXXXXXXXXXXXXX" ; "forceTrust=1" ;"ssl=1" ) ] 
Set Variable [ $result ; Value: EmailCreate( "xxxxxxxxx@XXXXXXXXXXXXXX.com" ; $email ; MailingBlasts for MCC::blastSubject ) ] 
Set Variable [ $result ; Value: EmailSetHeader( "reply-to" ; "xxxxxxxxx@XXXXXXXXXXXXXX.com" ) ] 
Set Variable [ $result ; Value: EmailSetBody( $TEXT; "plain" ) ] 
Set Variable [ $result ; Value: EmailSetHeader( "Content-transfer-encoding" ; "base64" ) ] 
Set Variable [ $result ; Value: EmailSetBody( $HTML; "html" ) ] 
Set Variable [ $result ; Value: EmailSetHeader( "Content-transfer-encoding" ; "base64" ) ] 
Set Variable [ $result ; Value: EmailSend ] 
Set Variable [ $emailResult ; Value: EmailLastError ] 
Set Variable [ $result ; Value: EmailDisconnect ] 

Also tried it with "Content-Transfer-Encoding" if case-sensitivity was an issue. And with the EmailSetHeader before the EmailSetBody.




Edited by Dave Vaklyes
More information

Share this post

Link to post
Share on other sites

Hi Dave, 

If you read the headers of the sent email, is the content-transfer-encoding header listed there?

Share this post

Link to post
Share on other sites

Yes, they are.

In the text section: Content-Transfer-Encoding: quoted-printable

In the HTML section: Content-Transfer-Encoding: 7bit

So something is not working.

I attached the script steps I'm using to test this with. I am using plugin version 3.1, on FileMaker 17 (and higher). Same result on both FM Versions.


Share this post

Link to post
Share on other sites

Thats odd that it is not setting the header to the value you are passing it. Can you email me the txt file with the HTML in it? I would like to do some testing with it. Let's go ahead and get you an official support case. Send the txt file to support@360works.com and just leave a link to this thread and attn Ryan in the body of the email. 

Share this post

Link to post
Share on other sites

This topic is 382 days old. Please don't post here. Open a new topic instead.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By Jhon Doe
      Hi everyone
      i'm new in filemaker, i'm using filemaker 17 and currently i'm involve in a proyect but i have a problem that i can't resolve, maybe someone of you have had the same problem.  
      I'm saving images in base64 format in a database to show them in a layout with web viewer,that doesn't has any problem, the problem is that i'm using a portal and i didn't know that portals don't support web viewer. I have to display those images but i can't remove the portal since i didn't do that layout and it has scripts using it along with the portal, is there a way to show images saved in base64 without use web viewer? (I've already tried to use container field but it only show a "?" image 😓 )
      My English is not the best but I tried my best ,Thanks for your help
    • By muzz
      I recently tried to implement a Base64 Encode/Decode approach to create a vCard from FMPro as previously described in this post https://radicalappdev.com/blog_02/. The file resides on an iMac at my front office desk running FMPAdv13. When opening the file and running the Base64 script to export the vCard on this Mac, I get an empty card however if I run the file from from FMPAdv15 from my laptop on the same network (hosted on the FMPAdv13 Mac) the vCard is exported as expected.
      I looked at the encode function and found that in the FM13 file the field has a single "?" however in the FM15 view it is filled with data (screenshots attached).
      Can anyone shed light on how to implement this correctly from the FM13 client? I have changed the vCard format to suit my needs but nevertheless the 2 different versions do perform differently. Using FM14 behaves as expected (i.e. the same as FM15).
      Thanks, Murray

    • By troi
      Updated plug-in for FileMaker Pro 14 offers industry strength encryption and decryption of data and images.   June 5th, 2015, Alphen aan den Rijn, The Netherlands--Troi Automatisering today announced the availability of Troi Encryptor Plug-in 3.0 for FileMaker Pro 14.     What is Troi Encryptor Plug-in?   Troi Encryptor Plug-in is a very powerful tool for for securing your FileMaker data, exporting or emailing your data without risk and importing safely back into FileMaker. All from within FileMaker you can:   - encrypt text or container fields, using the powerful 256-bit AES encryption scheme, so that your sensitive data is secure - export encrypted data that can be sent safely over internet, for example via email. No risk that someone will read or change the data while in transit - use the decryption functions to restore the original information after you have imported the received email or export file back into FileMaker, with the assurance that nobody will have tampered with it - verify data integrity and sources with SHA-1 message digests - encode text in Base64 - make conversions to and from binary - compress databases with large text fields     What is new in version 3.0?   Troi Encryptor Plug-in 3.0 is a major release, offering the following changes:   - Tested and made compatible with FileMaker Pro 12, 13 and 14. - Added support for 64-bit architecture with FileMaker Pro 14: on OS X the 32-bit and 64-bit version is a single universal plug-in and on Windows there are 2 plug-ins: Troi_Encryptor.fmx (for 32-bit) and Troi_Encryptor.fmx64 (for 64-bit). - Tested with OS X 10.9 Mavericks, OS X 10.10 Yosemite and Windows 8.x. - Added AES-256 bit encryption, up from 128-bit in earlier versions. - For backward compatibility: added a switch to the Encr_EncryptRijndaelAES function, which will generate AES-128 bit encryption. Also improved the Encr_DecryptRijndael function: for Troi AES encrypted text, it will automatically detect if it is AES-128 or AES-256 and decrypt the text. - Added 3 new functions to the plug-in, to be able to easily exchange AES-encrypted data with other systems (like for example PHP-mcrypt). Also added PHP mcrypt script which demonstrates how to decrypt data in PHP, which was encrypted in FileMaker with the EncryptAES.fmp12 example file. - Troi Encryptor Plug-in is now compatible to run under FileMaker Server. The plug-in creates log files when running under FileMaker Server to make troubleshooting easier and to provide feedback regarding errors and registration status. - Added the example file EasyInstallTroiPlugins.fmp12, with support for the 64-bit version of FileMaker Pro 14. - Several bug fixes and further improvements. - Made various changes to several example files.   More detailed information on all changes and improvements implemented in Troi Encryptor Plug-in 3.0 and earlier can be found at: http://www.troi.com/software/encryptorhistory.html     Suggested Uses   - secure your FileMaker data, making sure information can only be read or seen by the people you want - share medical data over internet, including pictures - comply with HIPAA guidelines - verify the correctness of important text - compress large texts   All these features also work in a runtime solution.   We invite you to test drive the new functions and see what you can do with it!     Pricing & Availability   A fully functional demo version of Troi Encryptor Plug-in 3.0 is available for downloading at Troi's Web site at: <http://www.troi.com/software/encryptorplugin.html>.   Troi Encryptor Plug-in 3.0 works with FileMaker Pro 12, 13 and 14. The plug-in can also be used with runtimes created by FileMaker Advanced 12, 13 and 14. The plug-in is available for OS X 10.6.x or higher, Windows Vista, Windows 7, Windows 8 and Windows 8.1.   Licenses cost US$ 79 per user. Details on developer licenses and multi-user discounts can be found on our web site. You can order licenses from our web site.     FileMaker Server requirements   Troi Encryptor Plug-in 3.0 also works with FileMaker Server 12, 13 and 14 as a server-side plug-in and as a plug-in used by the web publishing engine and WebDirect. To use this, you need to purchase a special cross-platform Server/Web license which costs US$ 399.   We have prepared extensive information on how to install and use Troi Plug-ins server-side and web-side on this web page: http://www.troi.com/support/filemaker-server-side-plug-ins.html     Upgrade information   Product updates from earlier versions, bought on or after September 1st, 2014, are free: eligible users will be emailed a new registration string. Contact us if you have not received yours after June 7th, 2015.    Upgrades from licenses bought before September 1st, 2014, are available from US$ 39 per user.   Upgrade prices for other licenses can be found on our web site. You can order upgrades from our web site.     About Troi Automatisering   Troi Automatisering develops professional iOS apps, is a leading developer of cross platform FileMaker Pro plug-ins and winner of the FileMaker Pro Excellence Award 2001. For more information, visit our web site at: http://www.troi.com/         Contact information     D. Budding Troi Automatisering   Newsroom: <http://www.troi.com/news/>
    • By Charles Delfs
      I'm looking for a way to convert text to and from Base64.
      Cant use a plugin and can't use a custom function (they are usually recursive and thus limited to processing string size)
      I could convert the Base64 encoded string to a data.txt file and export the file and read it but I can't export and read back in this application.
      Is there a way to read the contents of a container file without exporting it yet? ...
      Any amazing technique ideas would be much appreciated.
      P.S. Technically it does not have to be Base64, just a format 100% web transportable and postable.
    • By stuj1026
      Am I able to point to a file on my local hard drive in windows and set a field with the base 64 string of the file pointed to? Unable to find this in scriptmaster.

      Thanks Stu
  • Who Viewed the Topic

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.