AnsweredAssumed Answered

FM Server 12 - Running Script to send email with attachment - I am not getting it!

Question asked by KarenD on Mar 17, 2015
Latest reply on Mar 27, 2015 by KarenD


FM Server 12 - Running Script to send email with attachment - I am not getting it!

Your post

Hello, and thanks upfront for any help with this.. spent the last few days trying to figure this out, and no combo of anything is working for me. I am trying to have the server execute a simple script, find certain records, save as an excel file, and email the file. Small files, to boot. I understand that because it's running off the server, it has to be an export, (vs. a save records..) and it has to save it to the documents folder on the server where the FM files are. No matter what I try, I can't get it to save to this folder, that seems to be where the script is hanging up.

This is what I have, can anyone see what I am doing wrong, why this isn't working?

Allow User Abort [Off]

Set Error Capture [On]

Got to Layout ["EmailedPartsReminder" (Components)]

Show All Records

Set Field [PartsTracker::ReportName; "PartsDue.xls"]

Perform Find [Restore]

Export Records [No dialog; "OverDue.xls"; Unicode(UTF-16)]

                   (Specify output file I have:    filewin:C:/Program Files/FileMaker/FileMaker Server/Data/Documents/OverDue.xls )

Send Mail [Send via SMTP Server; No dialog; To:", Subject: "Parts now due"; Message: "Attached... blah blah blah..."; "OverDue.xls]

   (and in the attached in the send mail options, I have:   filewin:C:/Program Files/FileMaker/FileMaker Server/Data/Documents/OverDue.xls


Help! ? !  What am I missing here?

I've tried different path names to the folder it should be exporting to, and emailing from, like setting the variable:  [$AttachmentPath; Value:Get(DocumentsPath)]   <--- that didn't work either.

Thanks everyone - anyone!!