John
John

Reputation: 4944

Is It Easy to Make an Email Address Book Invite?

Twitter and Facebook invite new users to send an invitation to everyone in their Gmail, Hotmail, or Yahoo Mail accounts.

Is it easy to add this functionality to a website?

Thanks,

John

Upvotes: 1

Views: 1120

Answers (3)

Guss
Guss

Reputation: 32335

All of the above answers are correct, here is a summary and some more explanation:

  • You first need to get the user's login for each service you want to get contacts from (I personally don't understand why people would do that - I would never give my GMail password to Facebook, let along some little known web site).
  • Then you can simulate a login to the said website and grab their contact list as an export (all serious email services allow you to export the contact list as CSV or something). You can implement this yourself or use some external library such as contactgrabber mentioned by Haim.
  • You then go over their list of contacts and for each contact you generate a key (you want to generate a unique key for each email you send so you'd know who responded to you). Generating the keys is easy - take some info like the current user's email plus the target email address, add the current time and pass everything to a hashing function like SHA1 - should do the trick.
  • Now store in a database table for each contact you got: the inviting user's ID, the email address being invited and the key you generated.
  • Lastly send a nice email to each contact with a URL to your website's "invitation activation page" with the correct key applied - like so: http://www.somesite.com/invited?key=123456780abcdefgh

when that page is accessed, get the key from the URL and find it in the table - that would give you the email address that activated the invite and the user that invited them. From here you can take it to where ever you want.

Upvotes: 0

ema
ema

Reputation: 5773

Yes! What they generally do is to send in the email a special URL that contain a code, for example:

www.mysite.com?UserCode=ABC

That code (ABC) is associated to the email of the user so the application undestand which user is trying to subscribe. You must keep in a database the pair: email, code.

HTH

Upvotes: 0

Jeremy Logan
Jeremy Logan

Reputation: 47514

Last I checked you basically have to pretend to be a web browser then programatically log in to the site, scrape the contacts, then compose/send the message. It isn't difficult, but it is time consuming as each of these services works differently.

I does, however, look like people have written script for some of this though: example.

Upvotes: 2

Related Questions