Notice: Unknown: Connection failed to mail.domain.com,143: Connection timed out (errflg=2) in Unknown on line 0
imap_open("{mail.domain.com:143/novalidate-cert}INBOX", 'login', 'password')
The port 143 is open, I'm not behind a firewall, my server uses self-signed certificates.
I really don't understand why I can not connect to my mail server
I searched everywhere but I found no answer..
Thank you for your answers. My mistake was not coming from the connection but rather a loop that crashed the server when I had too much email :
imap_open("{mail.domain.com:143/novalidate-cert}INBOX", 'login', 'password')
$mails = imap_search($stream, 'UNSEEN');
rsort($mails);
foreach ($mails as $mailId) {
imap_fetch_overview($stream, $mailId, 0);
} //that was the mistake when email number is too big!
In my case, this did the trick:
imap_open("{mail.domain.com:110/pop3/notls}INBOX", 'login', 'password')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With