Jump to content

Having issues getting attachments to Mail to work


Recommended Posts

Hi everyone,

I'm trying to get attaching files go mails generated using FM17 to work. The idea is to attach a variable file to a mail-message generated for a specific record. The filename for the attachment is specific to the record and I've got a field that generates that filename (fileNamejpg01).

I'm using the send mail option in a script (which is working) and the option to attach a file by giving a file path. That file path looks like this:
file:../../../Desktop/werkmap/Beeldmateriaal/instagram/$fileNamejpg01 

The variable part is "$fileNamejpg01" and I'm sure I'm doing something really dumb ... but don't find anything that solves the problem (or that I at least understand).

Hope someone can help!

Thanks, Peter

Link to post
Share on other sites

The file path window and what you feed it is not a calculation window so you have to calc the path ahead of time and feed it the resulting variable

Set Variable[ $path ; Get(DesktopPath) & "werkmap/Beeldmateriaal/instagram/" & $fileNamejpg01 ]

Link to post
Share on other sites
18 hours ago, Wim Decorte said:

The file path window and what you feed it is not a calculation window so you have to calc the path ahead of time and feed it the resulting variable

Set Variable[ $path ; Get(DesktopPath) & "werkmap/Beeldmateriaal/instagram/" & $fileNamejpg01 ]

I'm staring blindly at a screen now after trying again ... I'll give it a rest until tomorrow and I'll let you know if I've gotten it to work Wim!

Link to post
Share on other sites

I'm lost ...

I've added two screenshots of what I have now but I can't get it to work. Been trying different options of all I could think of but not getting anywhere. 

Hope you can make sense of it Wim. It's probably something really dumb I've done but it would help a lot if I get to understand it and get it to work!

Thanks!

1.png

2.png

Link to post
Share on other sites

No, that last window is not a calculation dialog.  The only thing you should have there is:

 

$path

The $path variable needs to be set in your script before you get to the Send Mail script step

Link to post
Share on other sites

Thanks for you patience Wim!

I got it to work and cleaned up my folder structure a bit to make the whole think a bit more clean and simpel while I was at it. It makes the path-calculation a lot easier.

For future reference if people are looking for a similar solution I've included the screenshots of my results:
1. The window that will send the mail
2. The window that calculates the path to the image file
3. The entire script to get it working!

Thanks!

1.png

2.png

3.png

Link to post
Share on other sites
On 5/11/2020 at 7:08 PM, Wim Decorte said:

The file path window and what you feed it is not a calculation window

True, but it's worth noting that it is possible to enter a path as a mixture of literal text and variables. For example, after setting these variables:

Set Variable[ $workFolder ; Get(DesktopPath) & "werkmap" ]
Set Variable[ $filename ; YourTable::SomeField & ".jpg"

you could enter:

file:$workFolder/Beeldmateriaal/instagram/$filename

as a valid path into the Specify File window.

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Similar Content

    • By Tondats
      Hello guys, good evening!
      I'm from the Philippines. Just wanna ask if I can use Filemaker to make a website? Just like Wordpress and Joomla.
      If Yes, then what are the steps that I should do?
      Thanks!
    • By Helder Moreira
      I have in my small store, a sales system running on a POS with an extra display, for the customer to see what is being added to the invoice. How do I make the filemaker present on this small monitor the summary of what is being sold?

       
      how can I maker filemaker to display on the second monitor only the invoice.
    • By ch53
      Hello,
      I've come upon a strange phenomenon, and wonder what could have gone wrong: In layout mode, I select gray solid coloring for a couple of fields and their labels, but in Browse mode (both list and table views), the colors fail to show in some instances. Only in form view, everything is displayed as expected. Neither restarting FM nor the PC (win10) helped. I assume that the solution is simple, but somehow I can't come up with it, therefore: Many thanks in advance for helpful comments!




    • By John Link
      I'd like to be able to export a text file that would contain several fields from a single record, with each field on a separate line. Here's an example: John Q Public
      111 West First Street
      New York, NY 10001
      How might I do that? I know how to export csv or Excel files, but they don't satisfy my need.
    • By flutegirl
      To try to explain the setup as succinctly as possible:
      Database is running on a FM17 Server (on a Windows virtual(?) machine... Our IT department handles that part).
      The FM database does a number of imports every morning from our primary (4D) database, using an ODBC driver, but I have not found a way to have those imports run successfully from the server, so I have them running on an instance on a secondary user account on my desktop computer.
      The scripts are triggered by adding a record to a table, which is checked every five minutes using an OnTimer script.  I run a separate instance of FM17 on my user account so that I can use the database even if there is an import running.
      This solution has been working (fairly) well for a number of years, but last week, my desktop computer was updated to Mojave (10.14.6), and since that upgrade, it seems that the imports on the secondary account will only run while that user account is active.
      1) Is anyone else doing anything similar, where they have an instance of FM running on a separate user account?
      2) If so, have you had any trouble with Mojave, or have suggestions on what may be going on?
      3) Any suggestions on how to fix this?  My initial thought is to just open the database using FMP on the Server system and try having the imports run from there, but am concerned that might also have problems.
      Any suggestions would be greatly appreciated.
       
  • Who Viewed the Topic

    4 members have viewed this topic:
    sal88  fileman922  Noél Dubau  IdealData 

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.