cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Curling a hotmail account

From: Stephen Pynenburg <spynenburg_at_gmail.com>
Date: Sat, 30 Jul 2016 18:59:28 -0400

A few things to look out for:
1) Make sure all the IDs in the URL you're POSTing to are up-to-date and
correct, i.e. hit the login page and parse the <form action="*"> out to get
the URL, don't use it hard-coded
2) Make sure you are POSTing a value for each field in the form - it
doesn't look like you have anything for the "keep me signed in" box or for
the submit button itself
3) Watch out for any Javascript that fires on clicking the login button.
See if the site works in your browser with JS disabled and base your curl
method off of that site
4) The login page might be setting session cookies, etc. before login -
make sure you tell curl to accept those (if any)

The page looks pretty complicated - you might have your work cut out for
you. You might want to step back and consider whether whatever you're
trying to do would be easier with POP3, IMAP, etc.

Anyway, hope this helps.

Stephen

On Sat, Jul 30, 2016 at 6:02 PM, Reda Lotfi <redalotfi_at_passkart.com> wrote:

> Hey,
>
> Curling hotmail.com using the following code returns a "username/password
> error" despite their correctness. Any debugging suggestion ?
>
> $try = curl_init();
> curl_setopt_array($try, array(CURLOPT_POST => true,
> CURLOPT_POSTFIELDS => "loginfmt=email&login=email&passwd=password",
> CURLOPT_URL => "
> https://login.live.com/ppsecure/post.srf?wa=wsignin1.0&ct=1469906822&rver=6.6.6556.0&wp=MBI_SSL&wreply=https:%2F%2Foutlook.live.com%2Fowa%2F&id=292841&CBCXT=out&bk=1469906824&uaid=f317ac0874ff45cc9dcdc18d55ba5d58&pid=0",
> CURLOPT_FOLLOWLOCATION => true, CURLOPT_UNRESTRICTED_AUTH => true));
> curl_exec($try);
> curl_close($try);
>
> Regards,
> Reda
>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2016-07-31