| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read | ![]() |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I am trying to connect Gmail account using imap_open function of PHP.
I have used the imap_open function like this: For imap access imap_open ("{imap.gmail.com:993/imap/ssl}Inbox", "username@gmail.com", "password") For POP access imap_open("{pop.gmail.com:995/pop3/ssl}Inbox","username@gmail.com", "pasword") In both of the cases it failed to connect. So, can anyone tell me how to connect gmail accounts using imap_open function? |
|
||||
|
Off the top of my head Google, Yahoo and implement imapi in a non-standard way. You could try using this library instead (it requires CURL) http://gmail-lite.sourceforge.net/wo...ut/libgmailer/.
__________________
homo sum: humani nil a me alienum puto ... ( just Google it ) |
|
|||
|
Phpmailer, yes i have used it for sending mail using gmail SMTP, it worked fine. But that's not the problem, actually I want to retrieve mails by either POP or IMAP.
And gmail-lite, I will give it a try, but I don't think it will work, because I have used gmail-mobile form the same author, which uses same library, but it didn't work. Still I will give another try to gmail-lite, it might work. Anyway, thanks for your help. |
|
|||
|
No, It's just a general error, that it can not connect to the server.
This thing is really strange, that almost every email clients which allow IMAP or POP3 can easily connect to Gmail, then why not PHP? I have searched the net but no one came out with any proper solution. |
|
|||
|
There is no complex code, the error is at the elementary stage
Code:
$inbox=imap_open ("{imap.gmail.com:993/imap/ssl}Inbox", "username@gmail.com", "password")
or die("Error: " . imap_last_error());
|
|
|||
|
this is the code I use on one of my vbulletin forums...its in the form of a block, but the code is solid(even though it could be tidied up a bit lol)
<table border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%"> <tr> <td class="tcat"><span class="smallfont"><b>$vba_options[portal_blockbullet] GMail Login</b></span></td> </tr> <tr> <td class="alt1" style="text-align:center; font-family:arial,sans-serif" nowrap=nowrap> <div id=login style="font-family: arial,sans-serif"> <script type="text/javascript"><!-- function gaia_setFocus() { var f = null; if (document.getElementById) { f = document.getElementById("gaia_loginform"); } else if (window.gaia_loginform) { f = window.gaia_loginform; } if (f) { if (f.Email.value == null || f.Email.value == "") { f.Email.focus(); } else { f.Passwd.focus(); } } } //--> </script> <div style= id="gaia_loginbox" class="body"> <form action="https://www.google.com/accounts/ServiceLoginAuth" id="gaia_loginform" method="post"> <input type="hidden" name="continue" value="http://gmail.google.com/gmail?ui=html&zy=l"> <input type="hidden" name="service" value="mail"> <table cellpadding="1" cellspacing="0" border="0" id="gaia_table"> <tr> <td class="alt1" style="font-family: arial,sans-serif"> <font color="#aa1002" style="font-family: arial,sans-serif"> <div class="errorbox-good"> </div> </font> </td> </tr> <tr> <td class="alt1" nowrap style="font-family: arial,sans-serif" align="center"> <font size="-1" face="Arial, sans-serif" style="font-family: arial,sans-serif">Username</font></td> </tr> <tr> <td class="alt1" style="font-family: arial,sans-serif" align="center"> <div align="left" style="font-family: arial,sans-serif"> <input type="text" name="Email" value="" size="18"></div> </td> </tr> <tr> <td class="alt1" style="font-family: arial,sans-serif" align="center"> <font size="-1">Password</font></td> </tr> <tr> <td class="alt1" style="font-family: arial,sans-serif" align="center"> <div class="alt1" align="left" style="font-family: arial,sans-serif"> <input type="password" name="Passwd" autocomplete="off" size="18"></div> </td> </tr> <tr> <td class="alt1" style="font-family: arial,sans-serif" align="center"> <div class="alt1" style="font-family: arial,sans-serif"> <input type="submit" name="null" value="Sign in"> </div> </td> </tr> </table> </form> </div> </div> <script> <!-- if (is_browser_supported) { var form = el("gaia_loginform"); var url = form["continue"].value; url = StripParam(url, "ui=html"); url = StripParam(url, "zy=l"); form["continue"].value = url; } // --> </script> </tr> </table> <br/> Studsy |
![]() |
| Thread Tools | |
| Display Modes | |
|
|