using CURL or other method to access email contacts

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mottwsc
Forum Commoner
Posts: 55
Joined: Sun Dec 23, 2007 8:01 pm

using CURL or other method to access email contacts

Post by mottwsc »

I have a PHP application and am trying to allow users to import contacts from their favorite email systems. Right now, I'm targeting yahoo, gmail and hotmail - facebook friends would also be interesting. I'll need to allow users to log in, of course, and then have all of their contacts pulled into my application. From there, I'll present them to the user and allow them to pick which ones they want to email about my application. The important part is that I need to have control over what happens to the contact list to control certain aspects of my application.

So, here are my questions:
> Is CURL the right method to use to do this?
> Are there practical examples available that I can use and where might I find them?
> What things would I need to be aware of and prepare for regarding security/hacking since I'm accessing remote sites?

Thanks for your guidance.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: using CURL or other method to access email contacts

Post by pickle »

I'd see if each of those services have an API. Using a provided API will be much easier than screen scraping, or whatever else you're using cURL for.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Bind
Forum Contributor
Posts: 102
Joined: Wed Feb 03, 2010 1:22 am

Re: using CURL or other method to access email contacts

Post by Bind »

commercial - http://curl.phptrack.com/
free - http://www.nqbao.com/2009/11/the-easy-w ... ntact-list

good luck trying to convince your visitors to share their email system login credentials.
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: using CURL or other method to access email contacts

Post by cpetercarter »

Users will not, if they are sensible, simply give you their email usernames and passwords. Instead, you need to look at the APIs for the services you want to access. Gmail and Facebook (and possibly the others too - I haven't checked) have APIs which use OAuth to allow your application to access a users contact list/friends list. The user authorises your application to do this - if you have ever "authorised" a Facebook application, you will be familiar with the process.
Post Reply