2 Replies Latest reply on Jun 16, 2011 10:51 AM by TimothyNees

    How do I add attachment to email with email address

    TimothyNees

      Title

      How do I add attachment to email with email address

      Post

      Ok

      I'm not quite a genius with the program yet so take it easy on me please.  I'm trying to simplify things for my users in FM GO but I can't seem to find the solution.  After creating an invoice or report in FM Go the user can email it to a client.  The only problem is the email address is in the database and they can't access it without leaving the report.  And vise versa, if you create and email with clients email address in it you cant access the file to attach.  So my question is How do I create a report and email it with the clients email address and attachment installed into the email together?

        • 1. Re: How do I add attachment to email with email address
          TSGal

          Timothy Nees:

          Thank you for your post.

          You will need a script to save the report as PDF and attach it to an email.  An example script would be:

          Set Variable [ $FileName ; Value: "Invoice.pdf" ]
          Save Records as PDF [ No dialog ; "$FileName" ; Records being browsed ]
          Set Variable [ $PDFPath ; Value: Get (DocumentsPath) & $FileName ]
          Send Mail [ Send via E-mail Client ; To: "user1@abc.com" ; Subject: "Invoice" ; Message: "Test" ; "$PDFPath" ]

          The first step is setting the variable $FileName to the name of the PDF file you want to save.  In this example, I named the file "Invoice.pdf".

          The second step saves the file out to a PDF file.  I could have left out the first step and specified "Invoice.pdf" directly.  I used the "Records being browsed" option, but if this is an Invoice for one customer, then you will probably use "Current record" instead.

          The third step is storing the location of the PDF file into the variable $PDFPath

          The fourth step is to send the email, addressed here to user1@abc.com (but you could easily reference an Email field), Subject of "Invoice", Message of "Test", and attach the PDF file stored in the path $PDFPath variable.

          Let me know if you need additional clarification.

          TSGal
          FileMaker, Inc.

          • 2. Re: How do I add attachment to email with email address
            TimothyNees

            Thanks for the answer all I was missing was the $PDFPath variable,  I was trying to do it with the $filename variable with no success.

            Already tested and implemented, Thanks again.