1 2 Previous Next 24 Replies Latest reply on Aug 19, 2016 3:12 PM by DanielSmith

    html via send mail smtp


      Is there something standing in the way of sending html code in a send-mail email? I know send mail using smtp only sends text, but if that text is html, shouldn't the receiving client treat it as such? Or is there some other piece I'm missing?



        • 1. Re: html via send mail smtp

          njem wrote:


          Is there something standing in the way of sending html code in a send-mail email?


          Yeah ... the fact that it's not supported.  


          In order to do HTML mail, you'll have to:


          (a) Guarantee that you always have the same mail client and tailor the mail to fit. (For example, Lotus Notes will parse an HTML attachment as part of the body of the message. Most clients won't.)


          (b) Use a plugin.


          (c) Use a mail service such as Mandrill.

          • 2. Re: html via send mail smtp

            Mike, I had a license for some modules of 360Works at one time and they have some mail pulgin. I'll look at that, but your other two parts raise questions. If via a plugin I can send mail with formatting just as any client would then it should display in any client as well as that client will, right? If clients read mail differently, can't help that, but what goes out should be as standard as standard gets?

            Why a mail service? My domain hosting service should do the job shouldn't it?


            • 3. Re: html via send mail smtp

              HTML mail is tricky. But yes, if what you send is simple enough, then basically any email client should be able to handle it.


              Mandrill and services like it are not mail hosts. They're email aggregator services, primarily used for mailing lists. They can send from any domain, but they allow a lot of configuration options over the formatting of the mail, including HTML.

              • 4. Re: html via send mail smtp

                You need to set mail header as "Content-Type: text/html", otherwise it is sent as "Content-Type: text/plain" so the html should be shown as html source in client.


                Many of html mail is sent as "Content-Type: multipart/mixed" having both plain text and html, then some users (like me) read only plain text, never see the html part.

                • 5. Re: html via send mail smtp

                  And wouldn't it be nice if we could set the mail header?




                  • 6. Re: html via send mail smtp

                    I use SendGrid as they handle marketing and transactional email. They have an API, but I suppose most services do these days.

                    • 7. Re: html via send mail smtp

                      Do you use a plugin or what details can you provide? PM me if needed!



                      • 8. Re: html via send mail smtp

                        I personally use 360Works Mail, CNS Mail Plugin (SMTPit) and MBS plugin.  All work well for sending HTML email with the normal caveats on how the receiving mail client reads html email.  But more and more clients are reading them just fine and I do a lot more of it now for clients.  It just looks more professional.  Also, I find these plugins are more reliable for large volumes of emails than the built in FileMaker script function. 


                        360Workds CloudMail is new and designed to help send out batches of emails including HTML email.  It takes care of the mail server for you, but most what is most useful is that it also include analytics on your email blasts.  I haven't tried it, but have been looking for a reason or client that could make use of it to give it a spin. 

                        • 9. Re: html via send mail smtp

                          I've recently got very fond of using the elasticemail.com API for sending HTML email from FileMaker solutions as an alternative to Mandrill (which I previously have used, but they have changed their business model for the worse)... The ElasticEmail API is very simple and you can use the 'Insert from URL' script step... A basic script step could be:


                          Insert from URL [ resultField; "httpspost://api.elasticemail.com/v2/email/send?apikey=yourAPIkey&subject=" & SubjectField & "&from=" & fromEmailField & "&from_name=" & fromNameField & "&to=" & emailToField & "&body_html=" & messageHTMLfield ]


                          This will send the HTML formatted message as indicated... When run, the result field will give details of success etc... You can also get stats, and links clicked etc reports from the elasticemail.com control panel...


                          There is also lots more you can do with the API, so worth reading up on it....


                          The nice thing about elasticemail.com is that you can send up to 25,000 emails for free per month, and as the API doesn't require custom headers to be sent, then using 'Insert from URL' works great - no plugins etc, and it also works in FileMaker Go





                          • 10. Re: html via send mail smtp

                            +1 skywillmott.... I haven't tried elasticemail.com before, but it sounds promising.  Also, being an http post is probably more reliable than the FM email script step, especially for large volumes.  I'll have to give it a try sometime. 

                            • 11. Re: html via send mail smtp

                              beverly wrote:


                              Do you use a plugin or what details can you provide? PM me if needed!



                              beverly You can send HTML emails using Insert from URL script with the SendGrid API.

                              • 12. Re: html via send mail smtp



                                Basically the same as the elastic API. The following URL sample does need to be encoded and you just add fields for the url parameters in the URL calc.


                                https://api.sendgrid.com/api/mail.send.xml?api_user=your_sendgrid_username&api_key=your_sendgrid_password&to=destination@example.com&toname=Destination&subject=Example_Subject&text=testingtextbody&from=info@domain.com&html=r_sendgrid_username&api_key=your_sendgrid_password&to=destination@example.com&toname=Destination&subject=Example_Subject&text=testingtextbody&from=info@domain.com&html=<strong>testing html body</strong>


                                Jive really wants you to see the email link icons. I could not figure out how to remove them.


                                You can add CC and BCC and attachments. Although I have not tested with attachments.



                                I have a Pro plan with whitelisted IPs, but even the $10/month plan has access to the API.

                                1 of 1 people found this helpful
                                • 13. Re: html via send mail smtp

                                  A lot of the suggestions here are connected with services. If this client were sending a large volume that might make sense, but lots of hosting services are fine with even a couple hundred emails a day, and they're well below that. They just need the emails FM does send out to look nice. Paying a monthly fee forever just to get over that one little hurdle that FM doesn't, of allowing a way to send HTML, doesn't seem effective. I'll probably use the 360Works plugin. If they were sending a large volume it's not that hard to get registered as a bulk emailer and just go ahead and send your own, and not be at risk for being filtered just because of volume. I've never had any problem using Send Mail via SMTP. Once it's set it's set, and it gives me a fallback. If sending through the domain host SMTP fails for some reason (they're off line for the moment) I catch the error and resend via our ISP SMTP. It's only had to do that a couple times but at least I know failure or one service doesn't block other options.

                                  • 14. Re: html via send mail smtp

                                    I figured out how to send HTML mail from Filemaker Pro 14 without using any plugins, and it will work with any email provider.  My solution is for Windows only, but I can't see why it couldn't be adapted for Mac using Applescript.


                                    What I did was..


                                    1. Created a Filemaker Pro script that exports the information I need each time to send the email. It saves 3 text files to a fixed folder location on my PC (something like 'Desktop\html_mail_folder').

                                    • import2powershell_body.txt (this is the email body containing HTML tags, static text plus dynamic text based on content I grabbed from various fields in my database. Use ONLY single quotes...no double quotes in the text fields being output to files by the script making this and the other files.)

                                    • import2powershell_to.txt (the "To" email address)

                                    • import2powershell_subject.txt (the email subject line)


                                    You can make more files if you need non-static CC, BCC, etc, for your email.


                                    2. Created a static Windows batch script in the same folder called "run_powerscript.bat".  You can't run Powershell files directly in Windows, so the bat script acts as a trigger.

                                    4. My Filemaker Pro script also calls the bat file, which calls the static Powershell script in the same folder (powershell2.ps1)

                                    5. The Powershell script strips double quotes that are auto-added by Filemaker Pro around the content in the text files. It then sends the HTML formatted email based on the content of the 3 text files

                                    6. Powershell deletes the 3 text files


                                    Hope this helps somebody out. I'm sure there is room for improvement on this approach, but it was the best I could do in a few hours.

                                    1 2 Previous Next