I struggled with this for a while but have got it working on both the Mac and the iPad. The only difference between your settings and mine is that I use the Get ( TemproraryPath ) command, rather than Get ( Document Path ). This might make a difference.
Thank you for your post.
You should include the file extension ".pdf" within your script so the attachment can be recognized as a PDF file. Therefore, try the following:
If [ Get ( SystemPlatform ) = 3 )
Set Variable [ $FileName ; Value: Clients::C_FirstName & Sessions::Ses_Date & ".pdf" ]
Save Records as PDF [ No dialog ; "$FileName" ; Current record ]
Set Variable [ $PDFPath ; Value: Get (DocumentsPath) & $FileName ]
Send Mail [ Send via E-mail Client ; To: Clients::C_Email; CC: LOcations::Loc_Email; Subject: Clients::C_FirstName & " " & Sessions::Ses_Date; Attachment: "$PDFPath" ]
If Sessions::Ses_Date is a Date field, it may be formatted as MM/DD/YYYY. Since slash (/) characters are not recognized in file names on an iOS device, you would need to substitute slashes for underscores or hyphens. If this is the case, change the "Set Variable" step above to:
Set Variable [ $FileName ; Value: Clients::C_FirstName & Substitute ( Sessions::Ses_Date ; "/" ; "_" ) & ".pdf" ]
Keep me updated with any progress.
I am still stuggling with this - The script creates the email as I wanted but the pdf is not attached - any ideas?
Let's take it one step at a time. Does the PDF file get created? That is, when you return to the FileMaker Go home screen, is the PDF file listed?
Start simply by changing $FileName to a static result, like "Test.pdf". If this works, then try using the field name. If that works, then try adding the Substitute function with the Date field. Any other information you can provide would help pinpoint why the file isn't being sent.
Exact same problems here... I pretty much used an identical approach to the one above.
It kept complaining about failing to send mail, or (when SSL was on) that there was a problem with SSL, which wasn't helpful.
I found this great tool to help diagnose connection problems with FileMaker / SMTP, download the .fp7 file (works fine with FMP12 after conversion) from here: http://www.savvydata.com/blog/2009/11/fixing-smtp-send-mail-error-1506/
After seeing that all connections were being rejected on/off SSL, with/without passwords of various kinds, i set the SSL to 'on' and changed port to 465 using 'clear' password... that DID send an email. One caveat: On OSX, the FMP solution needs to be in the 'Documents' folder for this solution to send via SMTP - otherwise an empty message gets sent and it launches the mail client with an empty email as well, but with the attachment bizarrely enough.
So now i have a working solution (i.e. it sends the mail, addressees are correct and the attachment is attached), but it STILL launches my mail client created a message with the pdf attachment but otherwise empty... Any suggestions how i can suppress the mail client?