I am using curl function to login my web site using the Gmail username and password. Its working fine in my local environment but once i moving that file into my client server it returns the response "HTTP/1.1 401 Unauthorized". provied some solution
here is my curl function code for accessing gmail authentication...
$curl = curl_init('https://mail.google.com/mail/feed/atom');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_USERPWD, 'example@gmail.com:password');
$result = curl_exec($curl);
$code = curl_getinfo ($curl, CURLINFO_HTTP_CODE);
$code returns 200 Ok in my local environment but its return 401 Unauthorized in my client environment.