Page 1 of 1

I can't used php by imap_open for get all message in mail account from vesta cp

Posted: Thu Sep 01, 2022 9:08 pm
by wavesico
I can't used php for get all message in mail account from vesta cp

I used to php for get all massage in mail account as json from vesta cp but don't work it. How can I fix it ?

by imap_open

Code: Select all

<?php

    $imap = imap_open("{cordrr.tk:143/imap/tls}INBOX", "[email protected]", "admin");
    $headers = imap_headers($imap);

    if (!$headers) {
        print "Failed to retrieve headers\n";
    } else {
        foreach($headers as $header) {
            print "$header\n";
        }
    }

    imap_close($imap);
?>
Notice: Unknown: Can't connect to sev.cordrr.tk,143: Timed out (errflg=2) in Unknown on line 0

Re: I can't used php by imap_open for get all message in mail account from vesta cp

Posted: Wed Jul 19, 2023 2:46 pm
by nehavilash
Check that the PHP IMAP extension is installed and enabled on your server.
Check it on

Code: Select all

<?php
phpinfo();
?>
if yes then test if your server can connect to the mail server using telnet.

Code: Select all

telnet sev.cordrr.tk 143
I'm hoping above steps find you to determine the way out of this.