V
V
Vasily2019-07-13 17:54:41
PHP
Vasily, 2019-07-13 17:54:41

Error connecting to imap.ukr.net mail (Connection refused)?

I'm trying to start working with freemail.ukr.net mail:

<?php
    ini_set('display_errors', 'On'); // сообщения с ошибками будут показываться
    error_reporting(E_ALL); // E_ALL - отображаем ВСЕ ошибки
    //
    define('MAIL_IMAP_SERVER', 'imap.ukr.net');
    define('MAIL_IMAP_SERVER_PORT', 993);
    define('MAIL_IMAP_LOGIN', '[email protected]'); 
    define('MAIL_IMAP_PASS', 'xxxx'); 
    define('MAIL_IMAP_PATH', '{'.MAIL_IMAP_SERVER.':'.MAIL_IMAP_SERVER_PORT.'/imap/ssl}INBOX');
 
    $mbox = imap_open (MAIL_IMAP_PATH, MAIL_IMAP_LOGIN, MAIL_IMAP_PASS)
        OR die("Error: " . imap_last_error());
     
    print_r($mbox);
 
    echo('<br>done');
?>

"OR die" fires and writes the following:
Warning: imap_open(): Couldn't open stream {imap.ukr.net:993/imap/ssl}INBOX in /...www/mail.php on line 11
Error: Can't connect to imap.ukr.net,993: Connection refused
Notice: Unknown: Can't connect to imap.ukr.net,993: Connection refused (errflg=2) in Unknown on line 0

What could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CityCat4, 2019-07-13
@CityCat4

Are you sure that you are listening on port 993? The usual port for imap is 143. 993 is imaps, where you need to connect with a pre-installed SSL connection, this is an unpopular option.

D
Dimonchik, 2019-07-13
@dimonchik2013

telnet
debugging

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question