Jump to content

[SOLVED] curl question


adv

Recommended Posts

hello is there a way to read emails with curl ?

like in gmail ... inbox or trash

 

after i log in with curl and then go to lets say:

http://mail.google.com/mail/?shva=1#inbox

 

is there a way to open each message in inbox

i see that when u read a message it shows like this

http://mail.google.com/mail/?shva=1#inbox/11f08c542531d23d

 

but how do i do it without knowing /11f08c542531d23d

just to get all messages one by one ...

something like that :D thanks

Link to comment
https://forums.phpfreaks.com/topic/142301-solved-curl-question/
Share on other sites

Okay when you open gmail.. the page loads up and you see your messages (plus links) these are build by the dynamic page..

So http://mail.google.com/mail/?shva=1#inbox contains the links ie http://mail.google.com/mail/?shva=1#inbox/11f08c542531d23d, So if you read the html contents it must contain "?shva=1#inbox/11f08c542531d23d" thus you know the "inbox/11f08c542531d23d" code

 

however i truly recommand you take the imap route..

 

untested

<?php
$mbox = imap_open ("{imap.gmail.com:993/imap/ssl}INBOX", "[email protected]", "password")
     or die("can't connect: " . imap_last_error());
echo "<h1>Mailboxes</h1>\n";
$folders = imap_listmailbox($mbox, "{imap.gmail.com:993/imap/ssl}INBOX", "*");

if ($folders == false) {
    echo "Call failed<br />\n";
} else {
    foreach ($folders as $val) {
        echo $val . "<br />\n";
    }
}

echo "<h1>Headers in INBOX</h1>\n";
$headers = imap_headers($mbox);

if ($headers == false) {
    echo "Call failed<br />\n";
} else {
    foreach ($headers as $val) {
        echo $val . "<br />\n";
    }
}

imap_close($mbox);
?>

Link to comment
https://forums.phpfreaks.com/topic/142301-solved-curl-question/#findComment-745620
Share on other sites

Hotmail use "HTTP" access if you want POP you need to pay for the PLUS account..

So you could do the same for POP but only if you have a Plus account

 

Can you do that with hotmail give us a example please cheer's grate code.

 

 

EDIT: I may invest some time into creating a script that allows you to get message from hotmail without needing the plus account.

Link to comment
https://forums.phpfreaks.com/topic/142301-solved-curl-question/#findComment-745649
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.