Jump to content
Oyseka

Attaching .pdf to Mail

Recommended Posts

Hi all, I know this should be easy but I am not getting it right.

Screen Shot 2016-12-14 at 20.04.54.png

The mail gets sent but no attachment

Share this post


Link to post
Share on other sites

Here's an old demo I posted that might help.

Not really enough info to see what's going wrong with your script.  What is the value in InvItems::_InvID ? I'm wondering if there's a value in there that is breaking the $Path.

Share this post


Link to post
Share on other sites

Thanks for your response. The value in _InvId is just text (INXXXXXX). I am having trouble downloading the file above, I will keep trying it.

18 minutes ago, bcooney said:

Here's an old demo I posted that might help.

Not really enough info to see what's going wrong with your script.  What is the value in InvItems::_InvID ? I'm wondering if there's a value in there that is breaking the $Path.

Thanks I have downloaded the file and apart from selecting a temporary path I can see no difference. I have stepped through with Script Debugger but I can't tell if the PDF is actually being created

Share this post


Link to post
Share on other sites

Stop the script after the Save as PDF. Add the Auto Open to this script step. Do you see your PDF?

Share this post


Link to post
Share on other sites

Hi, yes the PDF opens ????

I put a field on the layout while trying to figure out what was going wrong with the calculation Get (TemporaryPath), I then copied that and put it into the finder GoToFolder field and got the error message "This Folder Can Not Be Found"

Share this post


Link to post
Share on other sites
Quote

Hi, yes the PDF opens ????

Is that a question?

If the PDF opens, then let's assume that it is successfully being created. Do you have FM Advanced? If so, you can step the script and see where you get errors.

If you put the dialog back ON in Send Mail it'll give you a chance to see if the PDF is attached.

Share this post


Link to post
Share on other sites

With the dialog On the attachment is sent so I turned it off again and stepped through it as before and the attachment is not present again. It appears that the attachment requires time to be attached before sending, how do I achieve that

Share this post


Link to post
Share on other sites

must the path be prefixed with "file:" maybe?

"file:$path"

 

(or switch to plugin for sending email with more options)

Share this post


Link to post
Share on other sites

Try adding a Pause before Send Mail.

Share this post


Link to post
Share on other sites

Hi, after I had posted the script on here I added a 2 second pause after the Save Records as PDF step to see if that helped. I am using FM 15 Advanced so I am using the script debugger to step through it. There are no errors shown but if I turn the dialog off on the Send Mail script step the attachment doesn't appear but the email is received.

Share this post


Link to post
Share on other sites
11 minutes ago, MonkeybreadSoftware said:

must the path be prefixed with "file:" maybe?

"file:$path"

 

(or switch to plugin for sending email with more options)

It doesn't appear to have a problem finding the file it just will not attach it without the dialog

1 minute ago, bcooney said:

OS X 10.11.6 El capitan

Thank you bcooney, that appears to be the problem. We were intending to move to using a plugin and smtp but were just trying to get our ducks in a row, now I know that the simple solution we were testing on may not be so simple

Share this post


Link to post
Share on other sites

If only FMI would provide a better Send Mail.

Share this post


Link to post
Share on other sites

we just use a plugin - the number of exceptions and workarounds required to keep emailing working correctly across multiple devices and platforms is just too 'hack' and loses us time and development

Share this post


Link to post
Share on other sites
On 14 December, 2016 at 9:14 PM, bcooney said:

Try adding a Pause before Send Mail.

Anything from 2-5 secs for PDF to write to disk in full depending on server spec may be needed. Or do shell script server side "sync;sync" if the server is a mac.

Edited by ggt667

Share this post


Link to post
Share on other sites

The FileMaker support article that is linked above provides the reason for your problem, there has been a bug between FileMaker and OS X for a couple of versions (of both) now, and it means that the 'Perform without Dialog' option cannot be used with OS X Mail. The article provides workarounds, but essentially you have to switch that option off (and the user will have to click 'Send' in OS X Mail), or send email via the built-in SMTP feature.

As Webko says, using a plug-in may be your best bet for better functionality, although not possible on FileMaker Go unless PSOS is an option for you.

Share this post


Link to post
Share on other sites

Thank you for your input. We had decided to go via SMTP as a fair number of the mail messages will be sent from Filemaker Go. SMTP however is creating it's own issues as there are apparently problems with Office365, which is our SMTP server and also that some servers don't accept TLS 1.0, which FM uses.

Share this post


Link to post
Share on other sites

Can you email them from Server?

MBS Plugin can email via CURL functions with TLS 1.0 on a FM Server or FM Pro.

Share this post


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 Rabernethy
      Hello
      I have inherited a database in Filemaker 12 on Windows, but I am completely new to databases. I have a script which generates and saves a pdf for each person using fields from their record. This works well.
      I then have a second script which is meant to email each of these pdfs to the corresponding person. I have included screen shots of the script and the "send mail" options.
      When I tested it by putting only my own email address in the To: box, it sent me hundreds of emails each with a different name in the text, and the correct corresponding pdf attached, as expected.
      Very embarrassingly, when I tried to send the pdfs out, it sent an email to each person with the right name in the body of the text, but all with the same email attachment (for the first person in the list)! What did I do wrong?
      Thank you in advance for any advice you can offer.


    • By john renfrew
      This has long been an issue, I have no idea why it happens and it is making life quite difficult
      Win Server 2012 FMS 16 (current but this happens on other configurations)
      With ScriptMaster installed 
      run a script which resets the server ( SMReset) and then loads jars and functions return to you the result of SMGetRegisteredModules and show it in a dialog box
      run another script on the server which just returns to you the result of SMGetRegisteredModules and show it in a dialog box
       
      dialog 1 SHOWS the modules you installed
      dialog 2 is EMPTY
      fmsadmin restart fmse
      do the above again, same result
       
      this means you can not do a test on the server to see if a particular function is loaded before you want to use it.... in fact there is no test you can do to see if the ScriptMaster has fallen over as far as I can tell.
       
      Any solutions???
    • By JMart
      Hi gurus,
      I am sure I’m missing something simple, but for the life of me I can’t figure this out. I have a database with tickets. What I want is when a new ticket is created I want to see a popover (see attached) then I want the user to type in the top box and as they type I want to filter the list below (a portal) and once they client is shown they would select it and a ticker is created for the client. I sound a script and modified to fit my needs but can’t get it to work. Can someone stretch a helping hand?
      BTW the filtering is working but its not reflecting in the popover its reflecting on the layout.


    • By elipsett
      I've been using FMP13 on MacOSX 10.12.6 with Apple Mail to send FMP-generated emails with attached PDFs. 
      I recently switched from Apple Mail to Airmail, and it is now impossible to send emails from FMP.

      Does anyone know if Airmail can send mail with attachments on Sierra MacOS 10.12.6, if I upgrade to FMP16?
      That's the only reason I might really need to upgrade, and since upgrading to FMP16 will also require a few new computers to run the new OS that the new FMP demands, I'd rather not spend all that money now if I can avoid it.
       
      Thanks.
    • By Hoytopher
      Hi all,
      I'm an FM novice who has a functioning database, and I'm trying to add layers of functionality to it. One feature I'm trying to design is a script to search through a Gmail outbox with certain keywords.
      In URLs, "%" translates to "%25". Filemaker appears to do this automatically - In Gmail syntax, you need to write "in%3Asent" to have the Gmail search bar contain "in:sent" which searches my outbox. Here's my current code for Go to URL:
      This "%" bit translates to "%25". I've tried "\%", I've tried creating a string, x, then having it open x, but no matter what I cannot get "%" to show up as-is, it always translates to "%25". Is there any way around this? I've tried subtracting text, but I just can't seem to get it to work. Any bright ideas? I can't find an answer to this specific question of disabling URL string substitution.
×

Important Information

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