4 Replies Latest reply on May 1, 2013 7:45 AM by jond

    e-mail not attaching file

    jond

      Title

      e-mail not attaching file

      Post

           Have a pdf file inserted into a container field (Projects:Summary) that I need to send as an e-mail attachment..

           Container field is set to interactive content and to save the file externally in open format (not secured)

           In a script:

           created a variable $Summary

           Set Variable [$Summary; GetValue ( GetAsText ( Projects::Summary ) ; 2 )]

           Set Variable $Summary2 to the desktop folder location plus $Summary without the leading pdf :

           in the send e-mail options checked the attach file and specified $Summary2 as the file path.

           e-mail is sent via client Outlook 2010 via exchange server but does not contain the attachment?

           To test the link I included $Summary2 in the body of the e-mail and it is correct as a copy paste of the link into explorer opens the pdf file.

           Using FMPro ADV 12.04 on Win 7 64 bit

           Any ideas that can help attach the pdf file would be greatly appreciated.

      Untitled.png

        • 1. Re: e-mail not attaching file
          philmodjunk

               I suggest posting the actual script.

               To post a script to the forum:

                 
          1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
          2.      
          3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here.
          4.      
          5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
          6.      
          7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
          • 2. Re: e-mail not attaching file
            jond

                 original post updated with script

            • 3. Re: e-mail not attaching file
              philmodjunk

                   I don't think your file path is valid.

                   Filemaker filepaths use / instead of \\ both in a $Path variable and stored in a "by reference" container field so there's no need to use a substitute function to turn / into \ like you do in line 9.

                   And the file path in line 10 should include the file extension.

                   Other notes.

                   If this is a "store a reference" container field, the full file path is stored in the container field, there's no need to use a text calculation like you have in line 10 to construct the file path.

                   If this is not a "by reference" container field, you need to export the field contents to a specified location such as the desktop or the temporary folder before attaching the file in the email.

                   You may find this thread and the "exploration" file you can download from a link in it, helpful: Exploring the use of a $Path Variable in Scripts

              • 4. Re: e-mail not attaching file
                jond

                     Figured it out.

                     manually attaching the exact file in the script did work.

                     The manual attchment of the file showed a reference that was relative to the location of the .fmp12 file and after many variations of the complete path c:\users... c:/users..., etc...    none allowed the file to be attached.

                     Also when inserting an externally stored pdf into a container field the second value in the container field starts with pdf : which needs to be changed to file:Files/ProjectName/ and then it attaches the file correctly.