PDA

View Full Version : Lots of emails to send - how to automate?




toddburch
Oct 11, 2007, 04:53 PM
I have a list of 322 clients that I wish to send an email notice to. Mail says the recipient list is too long, and my non-.mac email account won't allow it either.

Does anyone have an Applescript, or some such script, that will drive Mail on OS X (Tiger) to send each person an individual email? (the same text to each person)

I would appreciate it if you could share.

If it was Ruby, I could quickly customize it myself. Don't know a thing about Applescript, but I can learn!

Thanks, Todd



sord
Oct 11, 2007, 06:24 PM
Google for appletscript send mail comes up with this:
http://developer.apple.com/qa/qa2001/qa1018.html
You can just remove the part for attachments and throw it in a loop for your addresses I would assume.

AlmostThere
Oct 11, 2007, 06:30 PM
In a shell script with mail?

Don't have Ruby code but a simple Python example is given in the documentation ( http://docs.python.org/lib/node162.html ) including attachment support. Only a few lines - I use something similar for getting automated reports and exports from remote databases.

toddburch
Oct 12, 2007, 01:17 AM
Well, call me lazy I guess. Duh.

I looked at the Applescript (what I asked for), and that's just some weird syntax. What was Apple thinking?

Then, I looked at the Python. Better. But I figured if it could be done in Python, why not Ruby?

Enter Google. Yep. But even better, enter the BOOK THAT'S ALREADY SITTING IN MY LAP - the Ruby book. duh. Examples and everything. Never looked in that chapter before.

So, after a few minutes of setup, bada bing, bada boom - now I'm knocked off of my .mac mail account for 24 hours - I exceeded 200 emails in the last 24 hours period.

No biggy, I have other email accounts, and they're trucking along just fine, and unless you really dig into the email headers (and how many people do that?), it still looks like it came from my .mac account.

Mission accomplished. Thanks all!

Todd

kainjow
Oct 12, 2007, 02:00 AM
Well, call me lazy I guess. Duh.

I would have expected more from you. So disappointed! ;)

I looked at the Applescript (what I asked for), and that's just some weird syntax. What was Apple thinking?

AppleScript is old. Once you understand the flow, it is quite nice (but sometimes a royal pain in the arse).

So, after a few minutes of setup, bada bing, bada boom - now I'm knocked off of my .mac mail account for 24 hours - I exceeded 200 emails in the last 24 hours period.

Why don't you use a real email address?

demallien
Oct 12, 2007, 06:50 AM
Well, call me lazy I guess. Duh.

I looked at the Applescript (what I asked for), and that's just some weird syntax. What was Apple thinking?

Then, I looked at the Python. Better. But I figured if it could be done in Python, why not Ruby?

Enter Google. Yep. But even better, enter the BOOK THAT'S ALREADY SITTING IN MY LAP - the Ruby book. duh. Examples and everything. Never looked in that chapter before.

So, after a few minutes of setup, bada bing, bada boom - now I'm knocked off of my .mac mail account for 24 hours - I exceeded 200 emails in the last 24 hours period.

No biggy, I have other email accounts, and they're trucking along just fine, and unless you really dig into the email headers (and how many people do that?), it still looks like it came from my .mac account.

Mission accomplished. Thanks all!

Todd

Lol. Yeah, I was going to say, you can knock that over in Ruby in about 5 mins flat, even if you've never seen the SMTP API before... I had to do something similar for my little brother's business a couple of months back. I was pleasantly surprised that it was so easy, but then, Ruby is to programming what Macs are to general computing... It Just Works! (or in Ruby-speak: Principal Of Least Surprise).

toddburch
Oct 12, 2007, 07:37 AM
I would have expected more from you. So disappointed! ;)

Public ridicule accepted. I deserve it. ;)
Uh... I enjoy this community so much, I just needed an interaction fix?? Yeah! That's the ticket! An interaction fix! Yeah!

Why don't you use a real email address?

I have 7 email accounts (that I can remember). 1 gmail, 1 yahoo, 1 .mac, 3 from a website I used to have running and 1 godaddy website account, that I probably should have used, since that's the particular business account from which I should have been talking with my clients. But, I don't know the outgoing server info - but I'll get that today.

'til next "interaction"... Thanks!

Todd