Importing a Distribution List in Outlook

So I had to send out a notice to about 700 users. I had the list in the users table of my app’s database. I wanted to create a distribution list in Outlook. It’s not as straightfoward as it may sound.

The first step is to generate the csv file. Small complication: although I had access to the database, I did not have access to the server. So any output files MySQL generates are essentially out of my reach. Therefore, I needed to generate the file locally. No problem: MySQL has an –execute option which allows you to run multiple commands from the command line. It gets long and unwieldy, but it works. Here’s what I used:

mysql -u root -p db01 ^
  -e "select distinct concat(first_name, ' ', last_name, ', ', email) as name from users order by last_name, first_name;" ^
  >users_list.csv

(Yes, you can use the caret to continue a command on the next line. But don’t use a tab to indent your continuation. Spaces are cool though.)

OK, step one done.

Step two is creating a new distribution list in Outlook. You do that under Contacts. Click Select Members, to bring up a dialog box.

See the Members-> button near the bottom? The text field next to it is where you can paste your extracted list. (Now might be a good time to send a shout out to the morons who architected this brilliant bit of user experience. On behalf of users everywhere, I entreat you to find another line of work.)

This is great, but there is a caveat. As I said, my list was about 700 users long. Outlook wouldn’t accept that many records in a single DL: it came back with an error message. So I tried 200. Still no go. It did take 100. So I created 7 separate distribution lists, then one more to rule them all. The last distribution list contained the other 7, so I can just send my email to the one DL.

That’s all I have for now on distribution lists in Outlook. Hope this is useful.