Re: Scriptable Email apps
Re: Scriptable Email apps
- Subject: Re: Scriptable Email apps
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 15 Jul 2001 19:02:45 -0700
On 7/15/01 9:48 PM, "Lawrence M. Borland, M.D." <email@hidden> wrote:
>
Hello list:
>
>
I have a very simple project that requires a scriptable email program and
I
>
would welcome your recommendations for a scriptable email program.
>
>
This Applescript will launch the "scriptable email app" and then copy the
>
email from a list of email addresses which is stored in a text file with
>
each email address defined as a paragraph. After pasting paragraph 1
(first
>
email address) it will also paste a predefined text into the body, then
>
send the message. It will loop thru the paragraphs (email addresses) until
>
each has been sent and then quit.
>
>
Appreciate recommendations.
This should be pretty basic in most scriptable email apps. In Outlook
Express, there is no need for "pasting" nor for opening up messages on the
screen. It could all be done behind the scenes in the twinkling of an eye.
You could even send all the messages at once instead of one after the other.
set f to open for access textFile
set r to read f
close access f
set spamText to "some stuff here"
set theSubject to "Very Important"
tell application "Outlook Express"
launch -- in background if not open
repeat with i from 1 to (count paragraphs of r)
set aLine to paragraph i of r
if aLine "" then -- or: if aLine contains "@" then
set eAddress to paragraph i of r -- could include display name
if desired
make new outgoing message at out box folder with properties
{subject:theSubject, content:spamText, recipient:{address:eAddress}}
end if
end repeat
send -- sends all at once
end tell
---------------------
It gets more complicated if they're not To recipients, but they are here. If
you want, you can include the display name in the usual format:
"John Doe <email@hidden>"
But this way is better:
"\"John Doe\" <email@hidden>"
Or just email address:
"email@hidden"
Or
"<email@hidden>"
They will all work. You can send from a non-default account if you want
(ask), and lots of other options.
--
Paul Berkowitz