6 Replies Latest reply on Jun 30, 2015 10:14 PM by philmodjunk

    FM 14 - Attachments in the Send eMail script step?



      FM 14 - Attachments in the Send eMail script step?


      I'm  on FM14 Pro Adv with Win 7 and Win 8.1.

      I created a folder under the root of C: called "FM_eMail_Attachments".  Let's just say there are some .docs and .pdfs already sitting there.  In the "Send eMail" script, I know that FM does not have the ability to "shell out" to provide a Windows dialog UI that will show these files and allow the user to select one.  I'm thinking I have to "roll my own" list on a layout in the FM UI path, and show the user what's in the folder in a dynamic drop down value list before I can then show the user what file to select.  In a List view?

      So, I need to know if I can ask FM to drill down to the FM eMail Attachments folder, and return the list of files contained therein?

      Any possibility?  



        • 1. Re: FM 14 - Attachments in the Send eMail script step?

          Actually, you can get that dialog and not just in FileMaker 14. You can do it in older versions.

          Define a container field and set up your script to go to a layout where this container field is present. You then use Insert File as your means of opening  the windows dialog for selecting a file. You limit your user to only "store a reference" file insertions and when they select their file, a reference to it is inserted into the container field and then you can extract the file path from this field into a variable that you can then use with the send Mail script step to specify a file attachment.

          As with previous versions, you are still limited to a single attachment when using send mail.

          • 2. Re: FM 14 - Attachments in the Send eMail script step?

            OK, Mr. Phil -

            So as an adjunct to your instruction, this container field once the Insert File finishes, is going to contain the target file (one at a time, I know...) and thus permit the leveraging FM's ability to pop a Win dialog from the presence of the container.  This container field will show the file brought in and I'll need to clear the container field for its next use.  Do I have that sorta right?

            That's something I would have never thought of.  I'm trying it right now!!!



            • 3. Re: FM 14 - Attachments in the Send eMail script step?

              Two issues.

              When I open up the Attach file box, I see no item to click to point to the container field.  Do I need to type that in?

              In FM, in the eMail setting dialog, I input the correct port no for our provider.  It's defaulted to port 25.  So, I input the correct port no. as 3535 with no encryption.  I save it with OK.  I then leave and come back.  It's back to 25 again.  I tried various combinations of different port nos and combinations of encryption (which I don't need but I was experimenting...)  Save with an OK and come back again it's reverted to port 25.   Howcum?



              • 4. Re: FM 14 - Attachments in the Send eMail script step?

                You don't need to clear the container field between each use. Each time Insert File executes, it will overwrite any data already present in the field.

                You do not type in the container field. To repeat, you set a variable to the file path extracted from the container field. This requires a calculation to parse the text present in the container field as it is more than a simple file path. You  then type in the name of the variable, not the name of the container field.

                GetValue ( ContainerfieldHere ; 2 )

                will extract the file path from the container field provided that the file was inserted via Insert File and with "store a reference" specified. For more on $Path variables, container fields and the script steps that can use them see:Exploring the use of a $Path Variable in Scripts

                With regards to your last question, I have no idea.

                • 5. Re: FM 14 - Attachments in the Send eMail script step?

                  OK, I am trying to study the Extractor and what it reports for results.  I need to learn more on this process.  I've not found the correct method yet.

                  On the second question as to why the port no "sticks" on 25. 

                  I was able to reach FM by phone two days later.  I had the rep stumped.  Today he wrote back claiming they'd reviewed it and intimating that it must be a bad install and to reinstall.  Meh!  I responded with the results of my stumbling around which lead to my workaround.

                  I found I had to enter data in every field of that panel.  Then my port no. 3535 would hold.  If I took out certain pieces, like the CC add - it retains 3535. I commented out the Script Step.  Then went and created a whole completely new Send Mail Script Step.  I configured some bogus SMTP values with but port no: 3535.  Left it, came back.  Port 3535 is there.

                  So exactly what do we take from this?  I know that this is the first time I used that SMTP configuration panel with this fresh install of FM14 when I ran into the problem on June 25.  Does that mean the first time through you'll use this workaround and then all future instances will behave normally?  Can't say.  FM has the results of my very unscientific experiments.  What will they do with it?  Don't know.

                  Kinda like having a some vanilla ice cream.  Gee, I shoulda had chocolate chip....


                  • 6. Re: FM 14 - Attachments in the Send eMail script step?

                    I spelled out the "correct method" in my previous post. I suggested the Other thread and this exploration file as a way to learn more about this part of Filemaker, but all the steps you need are in my previous post.