Jump to content

lazarantal

Members
  • Posts

    11
  • Joined

  • Last visited

lazarantal's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. In the mean time, I found the answer. It is an UTF-7 encoded text. For some reasons (that I am not aware of), IMAP protocol still uses this old encoding. This is the site which helped me to figure out the solution. http://fetchmail.berlios.de/Mailbox-Names-UTF7.html In order to echo the text correctly, I just had to use the imap_utf7_decode function.
  2. echo ord('á'); This gives me 255, which is correct according to the extended ASCII table. 225 341 E1 11100001 á á á Latin small letter a with acute However, the above text is returned by Gmail imap (via a socket connection), so I assume it is correct. I just can`t figure out the encoding. Actually the question is why Google returns &AOE- instead of á for an á.
  3. According to this website the code is us-ascii code: http://www.string-functions.com/encodingtable.aspx?encoding=65000&decoding=20127 What I would like to achieve is to echo the corresponding utf8 character. In this case -> á.
  4. Hi, I have the following text: Utaz&AOE-s If I check the encoding of this text with mb_detect_encoding, it says that the text is pure ASCII. My page's encoding is UTF-8, so on the webpage I should see Utazás (&AOE- is an UT8 code for á. It doesnt matter what I do, the text is displayed as above. I've tried doing many things like converting the text to utf8, converting to utf7 than to utf8, .... Nothing worked. Any idea why cant I display the above text correcly? I also have this line in my code: header('Content-Type: text/html; charset=utf-8'); Any idea is appreciated! Thanks, Tony
  5. You are right, I've exchanged the single and double quotes and now I get the full response. I would not have thinked that this might cause the problem, the server returned a "Successfull" response (not a "bad command" one) Thank you!
  6. Thank you for the advices! @jazzman1 - As the folder structure returned by the Gmail LIST command may vary from user to user, it is not feasable to write the linux console's content into a file, and read it from there each time it's needed. That is why I am trying to execute the command from php and process the result in real time. @kicken - You are right, fgets is stoped and blocked if no data can be read from the socket. However in my case the fgets is getting stopped (not blocked) when the loop is reaching the point when there is no more data provided. According to the documentations and according to the linux console response my php script should get (and echo) the following: C02 LIST "" "*" * LIST (\HasNoChildren) "/" "INBOX" * LIST (\Noselect \HasChildren) "/" "[Gmail]" * LIST (\HasNoChildren \All) "/" "[Gmail]/All Mail" * LIST (\HasNoChildren \Drafts) "/" "[Gmail]/Drafts" * LIST (\HasNoChildren \Important) "/" "[Gmail]/Important" * LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail" * LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam" * LIST (\HasNoChildren \Flagged) "/" "[Gmail]/Starred" * LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash" C02 OK Success I know that the fgets is not blocked because the last line is printed (which is also the stop condition): C02 OK Success For some reason my php script is not getting or not printing the lines before the last one (All the starred lines).
  7. Which one? The one from the Linux console, or the one returned by the php script?
  8. Hi, I am trying to use the LIST command provided by Google for IMAP (as an extension). If I connect to gmail imap from linux telnet and send this command from the console, I get the following result: [#####@#### ~]$ telnet-ssl -z ssl imap.gmail.com 993 Trying 64.233.183.111... Connected to gmail-imap.l.google.com. Escape character is '^]'. * OK Gimap ready for requests from 81.201.58.35 f4if1005730nfh.69 1 LIST "" "*" * LIST (\HasNoChildren) "/" "INBOX" * LIST (\Noselect \HasChildren) "/" "[Gmail]" * LIST (\HasNoChildren \All) "/" "[Gmail]/All Mail" * LIST (\HasNoChildren \Drafts) "/" "[Gmail]/Drafts" * LIST (\HasNoChildren \Important) "/" "[Gmail]/Important" * LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail" * LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam" * LIST (\HasNoChildren \Flagged) "/" "[Gmail]/Starred" * LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash" 1 OK Success If I am sending this command from php, I am receiving only the last line: * OK Gimap ready for requests from 212.51.93.33 e8if455192eeo.69 * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE C01 OK ###########@gmail.com ######## authenticated (Success) C02 OK Success My php code is the following: fwrite($fp, "C01 LOGIN username password\r\n"); while ($line = fgets($fp)) { echo $line; $line = preg_split('/\s+/', $line, 0, PREG_SPLIT_NO_EMPTY); $code = $line[0]; if (strtoupper($code) == 'C01') { break; } } fwrite($fp, "C02 LIST '' '*'\r\n"); while ($line2 = fgets($fp)) { echo $line2; $line2 = preg_split('/\s+/', $line2, 0, PREG_SPLIT_NO_EMPTY); $code = $line2[0]; if (strtoupper($code) == 'C02') { break; } } What am I doing wrong? Regards, Tony
  9. Hi! Thanks for the replay. I wasn't precise enough. There are four divs inside the container, 3 with fixed width and the middle one with 100% width. Regards, Tony
  10. Hi, I would like to achieve the following: -------------------------------------------------------------------------- | fixed width | fixed width | 100% width | fixed width | -------------------------------------------------------------------------- Dou you know how could I achieve this with css?
  11. Dear All, I am trying to put together a php application, which connects to Gmail IMAP server and downloads a user's inbox folders and mails. The problem I am currently facing (and apparently can't resolve) is, when I am downloading the gmail folders with imap_list function, I am getting localized labels / folder names. Is there any way to always get the native English names? I know that Google has an IMAP extension, namely XLIST, which addresses this issue, but I haven't found an example of using this extension with php. I've found examples of using XLIST with frameworks like Zend, but since I am not using them, those examples did not help me. Is there a way of using Google's and Apple's IMAP extension in php (without any framework)? Or, I have to use a php extension? Do you know if PEAR's IMAP library can handles the Google IMAP extension? Any help is highly appreciated! Regards, Antal
×
×
  • 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.