Re: Scripting OS X Mail app
Re: Scripting OS X Mail app
- Subject: Re: Scripting OS X Mail app
- From: Steven Angier <email@hidden>
- Date: Thu, 31 Jan 2002 22:56:43 +1100
- Organization: Macscript.com
email@hidden wrote:
>
Well, actually, what I was looking to do (when I started this thread) was
>
send mail via 2 different Filemaker Pro databases from which I hoped to send
>
mail via 2 different POP accounts. Thus, I hoped to run one FM script, send
>
that mail, then run another FM script in another database, and send mail via
>
another POP account, and do it all while I was sleeping, so as not to have a
>
need for any manual changing. (thus the need for some script that would
>
change the "default" email account) And all in OS X, to boot, if you please.
>
It all just seemed like something that was relatively doable in my mind, but
>
it turned out to be hella complicated. I started out thinking Entourage was
>
my best bet, but after working with that program for a bit, I decided it was
>
not to my liking. I'm not going to go into why because I know that everyone
>
has individual needs that are met by various applications, and I don't want a
>
flame war (if this list is even inclined to that). But I'm now thinking I
>
prefer Apple Mail to Entourage, in a big way.
>
>
HOWEVER, if anyone out there has any brilliant ideas (or even less than
>
brilliant ideas . . you know . . like mine :) ), of how I could accomplish a
>
POP switch with some email app without me having to manually do it, ANY email
>
app that would also be more or less compatible with Filemaker, I'd be oh so
>
happy to hear about it. Or even really . . even if it's not compatible with
>
FM, I'd still like to hear about it, just so I can keep an eye on it, or
>
consider it if I decide to do a text file import.
I have done several FileMaker-based mail solutions over the years. I might just package one
up and sell it :-)
OE/Entourage can be a bit difficult. Firstly, you can't send a message without having set
up a POP account (perhaps this is an anti-spam measure?) so you have to create a POP
account based on each sender's information. You also have to watch out that you don't try
to exceed the limit of 127 POP accounts -- so your code has to manage and destroy the POP
accounts when you are finished with them -- so you need to check that the messages using
the account have been sent before you destroy the POP account -- etc.
Then you have to build a list of recipients in a fairly unintuitive way IMHO.
Many email clients allow you specify separate lists of TO, CC, and BCC recipients; if the
CC list is empty, fine; if you supply a list of TO addresses, thats fine too.
OE/Entourage requires that you build a record of type recipient for each recipient:
{address: "actual email address", recipient type: to/cc/bcc recipient} and throw them all
into the one list. Furthermore, you have to create an "outgoing" message (as if you would
want to create an "incoming" message!), and assign the recipient list when you create the
message (i.e. make new outgoing message with properties {blah}) because it will error if
you try to set the recipients property after you create the message.
The combination of these factors make it a frustrating experience to new scripters. Being
able to send attachments was the only reason we left Mail OSAX from Vampire Software.
Steven Angier
Macscript.com