Sunday, February 1, 2009

Making a mail list from all mailing addresses lying around

I was recently on a project of spreading words about my new magazine, for which I was not getting contributors. The best idea I could think of, was to mail people and let them know about it. So, I got out all mail addresses from my orkut account, my address book, and some mail list that used to email all recipients in one go, from which I got most of the addresses. Now, the problem was that, I could not make it typing 1070 email addresses in the To field of my email client. I had to get them in one csv (comma separated value) list. This article would rather be a how to on this topic. I wrote programs for that, whose source code is freely available here along with makefiles and a readme file.

  1. The first thing was to get the list in a file in some format. The mail list was the first target, which had many addresses. So, I had them in space (' ') separated format. So, I wrote a program eliminateduplication, which will also eliminate the duplication of email addresses, that is two addresses in the same list, and give the output in another file in csv format.
  2. The second source of addresses was Orkut. I pulled out all contacts in csv format. But, this time it had the names as well. So, I had to open it in a spreadsheet program. Although I used Open Office, Microsoft Excel will do fine. Then all I did, was copy the specific column containing the email addresses, and pasted in a file, where the addresses got separated by Enter. For this, I used the program crlf_to_space, which will take input from the file maillist.13 and put it in a space separated file maillist, which can be later put in maillist.csv.
  3. The last thing I did, was open the maillist.csv file in a text editor (kwrite, gedit and notepad are examples), and copied the whole list to the To field. The problem was solved.
The programs are made with standard C functions. So, the program should compile with any gnu compatible compiler, like gcc in Linux and mingw in Windows. Other compilers will also work, but one will have to compile the individual files, because the Makefile is GNU compatible.

Instructions:
  • Do not delete the maillist file, because any later additions can be done to it, and eliminateduplications will just write those in csv format to maillist.csv, overwriting any existing addresses.
  • Download your gmail contacts in csv, and copy email addresses as instructed earlier. Then use crlf_to_space, to append those addresses to the maillist file. This will not overwrite the already existing addresses in that file.
  • After this, use the eliminateduplications program to save the space separated email addresses in maillist to maillist.csv in csv format.
Application:
  • These programs can be useful in gathering various email addresses from different locations, and using them all in one go, without having to type the individual messages.
Download The Mailing List Project:

No comments: