Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Email Mail Merge




On 24-Jul-06, at 4:53 PM, Stockly, Ed wrote:

I have a need for a fairly basic mail merge script to work with Address Book and Mail.

I need to send an individual message to every person in an address book group, using their first and last names.

I've just started toying with Mail, I hoped it would be as simple as

make new message at beginning with properties {to: "email@hidden"; contents "Hello World"; subject: "Foo Bar"; attachments : {list of file refs}

	send message 1

So, before I start reinventing the wheel I'm wondering if anyone else has covered this ground before.

Thanks

Here's the routine I use in an ASStudio app for our reporterss to file their pictures (Note: "ToAddress is a global as the app always send to the same recipient):


---------------
on SendPic(theMessage, the_file, the_sender, theNewName)
tell application "Mail"
activate
try
set the new_message to ¬
(make new outgoing message with properties ¬
{visible:true, content:theMessage, subject:the_sender})
tell the new_message
make new to recipient at end of to recipients with properties {address:ToAddress}
tell content
make new attachment with properties ¬
{file name:the_file} at before the first character
end tell
end tell
end try
send the new_message
end tell
end SendPic
-----------------


Hope that helps.

djb
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Email Mail Merge (From: "Stockly, Ed" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.