A solution for generating emails with attachments from Filemaker Pro was needed by me… I has some problems with having unqiue name file attachments, but found a way around thanks to FM Forums.
I start with the question that was similar to mine, still I needed another solution and found one bin the following way:
07/29/09 01:33 PM – Post#337047 – Post Rank:
I’m trying to send a series of emails. Each email has a different .mp3 file attached to the email … each .mp3 is referenced to a container field (Insert QuickTime) … one container field per record. Is there a way to do an email file attachment using a calculation? It seems like the “Send Mail” script step only allows one specific file to be attached to all the emails.
==========
I came to this question because of a similar question and the answers were almost right for me, so I like to add this tiny thing to it:

Fenton wrote:
A FileMaker syntax path can be seen in the Help, and also at the bottom of all of those dialogs. In this case you’d use an full path, which might look like:
$filemac:/Macintosh HD/Users/fej/Desktop/some file.mp3
This was almost clear to me, but I had to do some try & error before I figured out what Fenton actually meant.
It is about the $ that indicates a local variable and which should not be made part of the file path string.
$filemac:/Macintosh HD/Users/fej/Desktop/some file.mp3
May suggest that the $ sign is a part of the file path string, but it is NOT.
This can be obvious for people working daily in FMP programming, but I am a user who comes back to this program only from time to time and always had had [problems with refined understanding of syntax… I need just a simple clear example.
So let me give one such an example here, so other “dumbos” like me may profit:
I use the script step: Set Variable and give the following calculation
$EmailAttachmentPath =
Substitute(AMSnote::gAttachmentFolderFilePathX; “/Volumes”; “filemac:”)
In my global field
gAttachmentFolderFilePathX
I have stored a calculated file path and name that includes a folder on a certain hard disk volume (I use InsideScan plugin for storing this and that plugin gives by default the file path in the format /Volumes/… etcetera)
As I am not yet sure whether or not FMP 10 want the file path formulated as [b]filemac:[/b] or with the [b]/Volumes[/b] format I just reformatted the folder path name to be the same as in the example by Fenton.
Almost there …
So then in the [b]email script step[/b] I simply enter as the attachment the string
$EmailAttachmentPath
… and that works perfect.
I have chosen thjs way of working as I am first exporting the image I am attaching to an email to a directory that is stored in global field and want the names of the attached image files to correspond with the unique indicators of the fields in my database (I use sets of repeating fields to store my data).
Last I keep wondering why in newer versions of Filemaker the option of a variable file attachment is not included. Now we have something that is in fact such a function, but seems to be more of a workaround (so freuqnetly needed in Filemaker… which I use for over a decade now).