adv Posted January 24, 2009 Share Posted January 24, 2009 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 thanks Quote Link to comment https://forums.phpfreaks.com/topic/142301-solved-curl-question/ Share on other sites More sharing options...
MadTechie Posted January 24, 2009 Share Posted January 24, 2009 When you curl the first page it's likes will have the "11f08c542531d23d" code.. BUT why not just use imap to connect to the gmail server ? and use it correctly Quote Link to comment https://forums.phpfreaks.com/topic/142301-solved-curl-question/#findComment-745601 Share on other sites More sharing options...
adv Posted January 25, 2009 Author Share Posted January 25, 2009 thanks for your answer but i dont quite undetstand what u mean When you curl the first page it's likes will have the "11f08c542531d23d" code. and i wanna find out if theres a way with curl .. not other methods Quote Link to comment https://forums.phpfreaks.com/topic/142301-solved-curl-question/#findComment-745617 Share on other sites More sharing options...
MadTechie Posted January 25, 2009 Share Posted January 25, 2009 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", "username@gmail.com", "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); ?> Quote Link to comment https://forums.phpfreaks.com/topic/142301-solved-curl-question/#findComment-745620 Share on other sites More sharing options...
redarrow Posted January 25, 2009 Share Posted January 25, 2009 Can you do that with hotmail give us a example please cheer's grate code. Quote Link to comment https://forums.phpfreaks.com/topic/142301-solved-curl-question/#findComment-745638 Share on other sites More sharing options...
rubing Posted January 25, 2009 Share Posted January 25, 2009 it looks like a lot of people have already written classes to do these sorts of things. just search google. here's an example of a gmail php class: http://gmail-lite.sourceforge.net/wordpress/index.php/about/libgmailer/ Quote Link to comment https://forums.phpfreaks.com/topic/142301-solved-curl-question/#findComment-745644 Share on other sites More sharing options...
MadTechie Posted January 25, 2009 Share Posted January 25, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/142301-solved-curl-question/#findComment-745649 Share on other sites More sharing options...
adv Posted January 25, 2009 Author Share Posted January 25, 2009 madtechie thanks Quote Link to comment https://forums.phpfreaks.com/topic/142301-solved-curl-question/#findComment-745808 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.