note 82466 added to function.imap-open
| From: | Binit at osu1 dot php dot net | Date: | Fri, 11 Apr 2008 21:39:13 +0000 |
| Subject: | note 82466 added to function.imap-open | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138196@lists.php.net to get a copy of this message | ||
I was trying imap_open() function but I was continuously getting this error:
Array ( [0] => [CLOSED] IMAP connection broken (server response) )
I was finally able to solve this problem (which is a very common problem as I saw it on the net but
could not find any solution to it) so I'm posting my solution here which I hope will be useful
to others.
I used stunnel program (http://www.stunnel.org/) and made changes in the stunnel.conf file as
follows:
I added these lines:
[imapsClient]
accept = localhost:143
connect = imapserver:993
client = yes
sslVersion = TLSv1
This will map insecure imap connection from localhost:143 to imapserver:993 (IMAP with SSL).
After this I tried this code and it worked fine:
<?php
$user="";
$pass="";
$imap = @imap_open("{localhost:143}INBOX", $user, $pass);
?>
and I was able to do away with the errors.
A more detailed post about it can be found here:
http://www.phpfreaks.com/forums/index.php/topic,190628.0.html
----
Server IP: 64.71.164.2
Probable Submitter: 129.118.127.134
----
Manual Page -- http://www.php.net/manual/en/function.imap-open.php
Edit -- https://master.php.net/note/edit/82466
Del: integrated -- https://master.php.net/note/delete/82466/integrated
Del: useless -- https://master.php.net/note/delete/82466/useless
Del: bad code -- https://master.php.net/note/delete/82466/bad+code
Del: spam -- https://master.php.net/note/delete/82466/spam
Del: non-english -- https://master.php.net/note/delete/82466/non-english
Del: in docs -- https://master.php.net/note/delete/82466/in+docs
Del: other reasons-- https://master.php.net/note/delete/82466
Reject -- https://master.php.net/note/reject/82466
Search -- https://master.php.net/manage/user-notes.php