I am trying to connect and fetch messages of my hosting's email address using imap_open(), but its throwing errors.
$server = '{mail.booksnearby.in:143/imap/ssl/novalidate-cert}INBOX';
$imap_connection = imap_open($server, $login, $password);
$mailboxinfo = imap_mailboxmsginfo($imap_connection);
$messageCount = $mailboxinfo->Nmsgs;
The above throws this error: Array ( [0] => Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed.
If I change $server to
$server = '{mail.booksnearby.in:143}INBOX';
then it throws the following error
Certificate failure for mail.booksnearby.in: self signed certificate:
If $server is
$server = '{mail.booksnearby.in:143/imap/ssl/novalidate-cert}INBOX';
it throws
Array ( [0] => TLS/SSL failure for mail.booksnearby.in: SSL negotiation failed )
I can connect to the email account using an email client, with the same username password.
I can't seem to telnet in as well. Its running apache , cpanel and dovecat. Imap with Ssl support is enabled on my hosting..
IMAP validation errorConfirm the IMAP server and port settings are correct. Most IMAP ports will be 993 or 143. Verify the IMAP server meets the technical requirements for connecting an inbox via IMAP and SMTP. Your IT team might only allow certain IP addresses to access the IMAP service running on your IMAP server.
Are you sure that the port number is 143 (not 993)? Cause you are using a secure connection with self signed certificate as I see. Try to do that this way:
$server = '{mail.booksnearby.in:993/imap/ssl/novalidate-cert}INBOX';
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