6 Replies Latest reply on May 20, 2015 4:33 AM by Mike_Mitchell

    Send Mail - Mail app signatures

    fmdataweb

      I've been working on a script that sends out invoices to a found set of records using the Send Mail script step. We're on Mac OS X/FileMaker Pro v13.

       

      I've noticed in testing that when it creates the email in the Mac Mail application it creates the email subject/body/recipient address as expected but doesn't insert the default Mail signature that would usually get inserted when creating a new email manually.

       

      Does anyone know if it's possible to somehow get the email signature inserted - has anyone used AppleScript for example to do this as part of the FileMaker script?

        • 1. Re: Send Mail - Mail app signatures
          CarstenLevin

          Hi fmdataweb,

           

          Yes, you are right, sending mail via the email client seems to be a very open process.

           

          I would suggest a solution setting you and your script in the drivers seat.

           

          If it is important for you to send via the email client, do this:

          • Just as you can set the recipient email and the subject, you can set the body. Set the signature in the body.
          • You can even have more signatures and choose between them in a dialog, or let a script script choose, depending on your rules.

           

          I hope this is a help.

           

          Your filemaker and your script does not know which email client you are using, and it does not know which account you have active etc. in many ways this make sending mail via the client being an a little bit uncertain process. And to make matter even worse FileMaker will not know if your mail was actually sent.

          And different email clients may have each their behaviour.

           

          An alternative with much better controls that I would suggest is to send directly via an SMTP server from the script. Thereby getting better controll, including result and error codes from the script.

           

          best regards

           

          carsten

          • 2. Re: Send Mail - Mail app signatures
            fmdataweb

            Thanks Carsten for your reply.

             

            I should have mentioned that the signatures that we have created have graphics/colours etc (rich text) that we would like to use. I believe you can only send plain text emails via the SMTP server option which rules that out. I'm aware of plugins you can get to do this but we would like to use the Mail application if possible.

             

            thanks

            • 3. Re: Send Mail - Mail app signatures
              Mike_Mitchell

              A client of mine discovered that if you use Open URL with a "mailto:" link, it seems to trigger the mail client as a separate event. This may solve the problem (untested).

              • 4. Re: Send Mail - Mail app signatures
                CarstenLevin

                Hi again,

                 

                I get your point. And I agree that the email functionality in standard FileMaker is rather limited. Another limitation is that you can attach one, but not two or three files. And as you mention formatted text and html mail is not supported.

                 

                May I ask you some questions, before coming up with my advice:

                • How many mails do you want to send per day?
                • Is it mission critical communication?
                • Is the solution on a server?
                • How many users need to send emails with the script?

                 

                And perhaps a little more about how the mail function is used.

                 

                Best regards

                Carsten

                • 5. Re: Send Mail - Mail app signatures
                  CarstenLevin

                  Hi Mike,

                   

                  Problem: Open URL will probably not be able to attach a file, set the subject, the body etc.

                   

                  Best regards

                   

                  Carsten

                  • 6. Re: Send Mail - Mail app signatures
                    Mike_Mitchell

                    Hello, Carsten.

                     

                    I believe you can set the body and subject using a "mailto" link. Example:

                     

                         mailto:[address]?subject=[subject]&body=[body]

                     

                    They have to be URL encoded, but it still works.

                     

                    Attachments are a different issue, but since you're opening the mail in the client program, you could always do that manually.

                     

                    All that said, if you're trying to automate a large number of emails, then sending them via SMTP server is a better option. But if you want to send it from the client (including the signature, which is what I believe the OP is attempting), this might work for you.

                     

                    HTH

                     

                    Mike