In mail.app, get list of Previous Recipients for just one of the many email accounts

applescriptmail.app

I use mail.app to interact with about a dozen different email accounts, which I use for different purposes. I need to create a list of the Previous Recipients of just on of those email accounts. A forum I was admin for crashed, and we lost the member database. Luckily, to join they had to email the admin account, and I then sent them a welcome email. We have restarted it at a new location. I'd like to notify people who were activated before. Recipients is better than senders so I don't inadvertently invite all the spammers to join!

Since recipient auto-complete functions properly, mail.app must have access to senders/recipients directly and I just want to access that information for a specific single email account – the forum admin account and not my personal or other special purpose accounts.

Buscar웃 provided an AppleScript that solves this for Senders instead of Previous Recipients, but I've never used Applescript so my attempts to modify it were unsuccessful. See In mail.app, get list of recipients for just one of the many email accounts.

Best Answer

Try:

tell application "Mail" to set previousRecipients to address of every recipient of messages of mailbox "Sent Messages" of account "my account name"