|
|
IMAP Mail Receiver Error : Couldn't connect to server - PHP
|
Views : 263
|
|
Tagged in : PHP
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
<u>IMAP receive mail function</u>
function receiveMail($username,$password,$EmailAddress,$mailserver='localhost',$servertype='pop',$port='110',$ssl = false) //Constructure
{
if($servertype=='imap')
{
if($port=='') $port='143';
$strConnect='{'.$mailserver.':'.$port. '}INBOX';
}
else
{
$strConnect='{'.$mailserver.':'.$port. '/pop3'.($ssl ? "/ssl" : "").'}INBOX';
}
$this->server = $strConnect;
$this->username = $username;
$this->password = $password;
$this->email = $EmailAddress;
}
Above function is used to receive the mail and
If the error
Couldn't connect to server occurs
add /notls.
That is
replace the line
$strConnect='{'.$mailserver.':'.$port. '/pop3'.($ssl ? "/ssl" : "").'}INBOX';
with the below line
$strConnect='{'.$mailserver.':'.$port. '/pop3'.($ssl ? "/ssl" : "").'/notls}INBOX'; |
|
By - Nithya, On - 2010-08-25 |
|
|
|