Jump to content

Attaching .pdf to Mail


This topic is 2674 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
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

Link to comment
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"

Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
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

Link to comment
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
Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

This topic is 2674 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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