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.
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.
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).
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.
Problem: Open URL will probably not be able to attach a file, set the subject, the body etc.
I believe you can set the body and subject using a "mailto" link. Example:
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.