• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Apple Mail - Sending to multiple recipients
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple Mail - Sending to multiple recipients


  • Subject: Re: Apple Mail - Sending to multiple recipients
  • From: "koenig.yvan" <email@hidden>
  • Date: Sat, 12 Jan 2013 16:05:26 +0100


Le 12/01/2013 à 15:52, Simon Topliss <email@hidden> a écrit :

Hi all,

Does anyone have any tips on how to speed up creating a "to recipient" list in Mail? 

The following script takes about 2 minutes to create a new message for 500 recipients and about 8 minutes to create 1000 recipients. I need to be able to create a new message for 4000+ recipients but it takes way too long to be practical as things stand.

--------------------------------------------------------------

script s

property kEmailRec : missing value

on init()
set kEmailRec to ¬
{_subject:"This is the subject" as text ¬
, _body:"This is the body" as text ¬
, _to:{} ¬
}
end init

on addTestData()
repeat with i from 1 to 1000
set end of kEmailRec's _to to {"<test" & i & "@example.com>"}
end repeat
end addTestData

end script

s's init()
s's addTestData()

tell application "Mail"
set newMessage to make new outgoing message with properties {subject:s's kEmailRec's _subject, content:s's kEmailRec's _body & return & return}
tell newMessage
repeat with i from 1 to s's kEmailRec's _to's length
make new to recipient at end of to recipients with properties {address:item i of s's kEmailRec's _to}
end repeat
set visible to true
end tell
activate
end tell

--------------------------------------------------------------

I've tried the usual 'repeating with a script object's property' but it didn't make much difference. 

I suspect that the slowness is due to having to send an Apple Event every time to 'make new recipient at end' in the repeat loop.


Any ideas?

I would use  a double loop building the messages by chunks of 100.
As far as I know, it's good practice because, at least here in France, providers dislike expedition of numerous mails in a single process.
So it would be fine to build 100 mails, send them
then repeat until there is unused addresses.

Yvan KOENIG (VALLAURIS, France) samedi 12 janvier 2013 16:05:16



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

This email sent to email@hidden

References: 
 >Apple Mail - Sending to multiple recipients (From: Simon Topliss <email@hidden>)

  • Prev by Date: Apple Mail - Sending to multiple recipients
  • Next by Date: Re: Apple Mail - Sending to multiple recipients
  • Previous by thread: Apple Mail - Sending to multiple recipients
  • Next by thread: Re: Apple Mail - Sending to multiple recipients
  • Index(es):
    • Date
    • Thread