1 Reply Latest reply on Feb 15, 2012 2:47 PM by BowdenData

    Send Mail with Attachment

    cretool

      I'm having an issue with sending an attachment in an email when running a script on a server schedule.

       

      I am using a Xserve OSX 10.6.8 and FMS 11.0.3.309

       

      I have a report of completed tasks and want the report to run every weekday at 6 PM.

       

      When I run the script on the client side from a button (as an instant override to waiting) the script runs the report, saves in on the server as a pdf in the right location, creates the email, fills in the body and attaches the correct pdf.

      When I run the script through the server schedule, the file won't save. The server then sends an email with the body but NO attachment.

       

      I am creating the path using variables. Here is the code to create the path and file name:

       

      Let([

      CurrentDate = Get(CurrentDate);

      month = Month(CurrentDate);

      day = Day(CurrentDate);

      year = Year(CurrentDate);

      date =month&"_"&day&"_"&year;

      path = "filemac:/Sever/Marketing/Daily Completed Tasks/";

      name = "Daily_Completed_Tasks_";

      type = ".pdf"

      ];

       

      path&name&date&type

       

      )

       

       

      Should my variable for path be different because the script is being run on the server and not from a client on a different computer? If it does need to be different, what should it be?

        • 1. Re: Send Mail with Attachment
          BowdenData

          cretool wrote:

           

          I'm having an issue with sending an attachment in an email when running a script on a server schedule.

           

          Should my variable for path be different because the script is being run on the server and not from a client on a different computer? If it does need to be different, what should it be?

           

          Hi,

           

          Correct. Path is different when running scripts on the server. The process only has access to the Server documents folder and the Server temp folder. Read the help document starting on page 131 of the PDF. Section is titled Running server-side scripts. You can also look at the built-in help in the FMS application as well.

           

          http://www.filemaker.com/support/product/docs/fms/fms11_help.pdf

           

          HTH.

           

          Doug de Stwolinska

          Bowden Data Services, LLC