Lots of emails to send - how to automate?

Discussion in 'Mac Programming' started by toddburch, Oct 11, 2007.

  1. toddburch macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #1
    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
     
  2. sord macrumors 6502

    Joined:
    Jun 16, 2004
    #2
  3. AlmostThere macrumors 6502a

    #3
    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.
     
  4. toddburch thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #4
    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
     
  5. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #5
    I would have expected more from you. So disappointed! ;)

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

    Why don't you use a real email address?
     
  6. demallien macrumors regular

    Joined:
    Oct 13, 2005
    #6
    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).
     
  7. toddburch thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #7
    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!

    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
     

Share This Page