3 Replies Latest reply on Jun 20, 2013 2:17 PM by philmodjunk

    Email pdf files from Remote on Filemaker Network not working

    sundown

      Title

      Email pdf files from Remote on Filemaker Network not working

      Post

           I am now able to email pdf files from my iMac that has the host FM files on it. I use the following generic functions I found on another discussion in my email script:

            

      Set Variable [ $FileName ; Value: "Invoice.pdf" ]

      Save Records as PDF [ Restore; No dialog ; "$FileName" ;Current record ]

      Set Variable [ $PDFPath ; Value: Get (DocumentsPath) & $FileName ]

      Send Mail [ Send via E-mail Client ; No dialog; To: "user1@abc.com" ; Subject: "Invoice" ; Message: "Test" ; "$FileName" ]

       While testing, I am sending the pdf file to my own email address. Running the script from the Host FM  file on my iMac & checking my mail on the iMac & macbook, all is well. The email is received with the attachment. I also get one of the   pdf files (not all) in the folder where the FM file is located. 

            I  then go to my macbookpro & open this database file on the Filemaker Network from the remote network. When I send a pdf file from the remote FM file, the email does NOT have the attachment.

           The attachment seems to only work correctly from the host computer & not from the remote network file. Do you know what is happening? I don't understand the $PDFPath variable and had to use the $FileName in the Send Mail function to get the attachment to work in the host iMac computer. I assume I don't have configured right.

           I have the host FM files on my iMac in a desktop folder called "Filemaker Files". Any help on how to configure the $PDFPath to get the pdf attachment to work from a Remote file?

            

        • 1. Re: Email pdf files from Remote on Filemaker Network not working
          philmodjunk

               Try it this way:

          Set Variable [ $PDFPath ; Value: Get (DocumentsPath) & "Invoice.pdf" ]

          Save Records as PDF [ Restore; No dialog ; "$PDFPath" ;Current record ]

          Send Mail [ Send via E-mail Client ; No dialog; To: "user1@abc.com" ; Subject: "Invoice" ; Message: "Test" ; "$PDFPath" ]

          • 2. Re: Email pdf files from Remote on Filemaker Network not working
            sundown

                 Thanks Phil. I just changed the functions like you suggested, and it now works great from the remote site.

                 Don't fully understand what I changed, but the pdf file no longer goes in my desktop database folder & the remote has the attachment. Would you briefly explain what I changed?

                 Thanks again for your quick response that solved my problem.

                 Bob

            • 3. Re: Email pdf files from Remote on Filemaker Network not working
              philmodjunk

                   The PDF is not saved in the user's Documents folder. That's the path specified in the $PDFpath variable and the save As PDF now uses that variable to determine the name and location of the file created by the Save As PDF step.

                   Before, the $PDFpath variable was not being used when the PDF was created. You had specified $FileName--a variable that only contained the name of the file.

                   WHen a file path only specifies the filename, FileMaker interprets that as a "relative file path". This will be a path that is relative to the location of the actual database file. If you were getting a PDF on your desktop, I must assume that your database file was also located on your desktop.