I would be so happy if someone could assist me in creating an Applescript to send some emails. I have seen a few examples but I am not confident that I can adapt them to my own needs.
I need to send the same email (subject & body), one at a time, to a list of addresses on a .csv file. I am using Apple Mail 5.3 and OSX 10.7.5
Many thanks in advance to anyone willing to help out.
Here's what I have so far.
tell application "Mail"
tell (make new outgoing message)
set theAddress to "xxxx"
make new to recipient at beginning of to recipients with properties {address:theAddress}
set subject to "xxxx"
set content to "xxxx"
send
end tell
end tell
I need to set theAddress to cell A1 on my excel sheet. How do I point it there? Once the email has sent I need to point it to cell A2… and so on.
Best Answer
The simplest and quickest way to do this in other languages would just be to drop each of your columns from excel into a list (array) and then have the whole thing in a loop and it will create the email fill the information and then send the email then loop back to the beginning and start again with values from each of the arrays at [1] and so on from there through your list. Not the most professional or efficient way but for your purposes that would work. If you can implement that then go ahead. If not I'll script it when I get back to my desktop.
----edit----
I edited script first written on this post: https://stackoverflow.com/questions/15386794/applescript-for-sending-emails-from-a-list-in-excel
to achieve this script. I code in java mostly so this might not be perfect so maybe somebody can come along and tweak it. OP should go through and enter his own values for the things written in all caps. Also the excel sheet needs to be in the form that the OP from the links excel sheet is in