8 Replies Latest reply on Aug 14, 2012 4:07 PM by Roger_1

    Email attachment

    Roger_1

      Title

      Email attachment

      Post

      I have a large file of photo's in Filemaker to go 12. This file is distributed to several individuals.

       We would like to send the contents of the container field to walmart in order to print the picture.

      How do you send an email with an attachment of just the container field?

       

      Roger

        • 1. Re: Email attachment
          TSGal

          Roger:

          Thank you for your post.

          If you just want to include the contents of the Container field, then export the contents of the field, and then attach that picture to the email.  Assuming your Container field is named "Container", a possible script would include:

          Export Field Contents [ Container ; "picture.jpg" ]
          Set Variable [ $FileAttachment ; Value: Get ( DocumentsPath ) & "picture.jpg" ]
          Send Mail [ Send via SMTP Server ; No dialog ; To: <email address> ; Subject: <subject> ; Message: <message> ; $FileAttachment ]

          -----

          The first step exports the contents of the Container field to a file named "picture.jpg".  Next, we create a variable where "picture.jpg" is located.  Then, in the last step, we send mail through the SMTP server to the appropriate person and use the variable $FileAttachment where the attachment is located.

          Let me know if you need additional clarificaton.

          TSGal
          FileMaker, Inc.

          • 2. Re: Email attachment
            Roger_1

            Thanks for your help. 

             

            Roger

             

            • 3. Re: Email attachment
              Roger_1

              This is the script I am using.


              Export Field Contents [ RWellsImages::Thumbnail; “file:Picture.jpg” ]
              Set Variable [ $FileAttachment; Value:Get(DocumentsPath) & "Picture.jpg" ]
              Show Custom Dialog [ Title: $FileAttachment; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]

              Send Mail [ Send via SMTP Server; To: "rwells1938@insightbb.com"; Subject: "Test"; Message: "test message"; Attachment: “$FileAttachment”; Name: "RWells"; Email Address: "rwells1938@insightbb.com"; Reply-To Address: "rwells1938@gmail.com"; SMTP Server: "smtp.gmail.com"; Port: 465; Use SSL; Authentication Type: Plain Password; User Name: "RWells1938"; Password: "XXXXXXXXXX" ]
              [ No dialog ]

              Show Custom Dialog [ Title: "Step 5"; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ] 

              The email got sent but no attachment. I must have done something wrong.

              Any suggestions?

              Thanks

              Roger

              • 4. Re: Email attachment
                NathanVeitch

                Hi Roger,

                 

                One thing I found with regards to FM Go is that when trying to get info out into email attachments, I had to use Get (TemporaryPath) and not Get ( DocumentsPath) and then I could email the attachment. With Get (DocumentsPath) on the iPad it places a copy in the FM Recent Files location. 

                 

                I hope this helps :)

                • 5. Re: Email attachment
                  Roger_1

                  Thanks

                   

                  I am running on an iMac to develope and will eventually move the project to an iPad.

                   

                  I tried the TemporaryPath but got the same results.

                   

                  Roger

                  • 6. Re: Email attachment
                    nancyhorne@centurytel.net

                    I just set up a script to save a pdf then send email from my ipad. The directions on page 17 of the fmgo_development.pdf worked perfectly.

                    The script for the mac is different than the script for ipad.

                    The set varialbe options were Name: $Output  Value: Get (TemporaryPath) & filename.pdf

                    Nancy

                    • 7. Re: Email attachment
                      NathanVeitch

                      Im still fairly new to FM so I'm not sure if I am right in saying this but, maybe try removing the file: and just having picture.jpg as the name for the Export, or maybe macfile:picture.jpg an not just file, cause isn't file for Windows enviroments. Just a thought :$ hope it helps. I know I was having a lot of difficulty with it, but the temportarypath worked for me in the end. 

                      • 8. Re: Email attachment
                        Roger_1

                        I finally got it to work on the Mac. I still need to test on the iPad.

                        Here is the script I finally ended up with. Notice that I only exported the field then emailed it. The export put the picture in the same folder that the program was being excuted from. So when I emailed it it picked it up from the same folder.

                         

                        Thanks for your help

                        Roger


                        #
                        #Export the selected picture to a file
                        Export Field Contents [ RWellsImages::Thumbnail; “file:Picture.jpg” ]

                        #Send the picture via email to wherever

                        Send Mail [ Send via SMTP Server; To: "rwells1938@gmail.com"; Subject: "Test"; Message: "test message"; Attachment: “file:Picture. jpg”; Name: "RWells"; Email Address: "rwells1938@insightbb.com"; Reply-To Address: "rwells1938@gmail.com"; SMTP Server: "smtp.gmail.com"; Port: 465; Use SSL; Authentication Type: Plain Password; User Name: "XXXXXXXXXX"; Password: "XXXXXXXXX" ] [ No dialog ]