Certificate error using IMAP in PHP

前端 未结 3 1946
青春惊慌失措
青春惊慌失措 2020-12-05 19:00

I used up all possible combinations of hostname but I always either get a certificate error or just IMAP connection broken.

Certificate failure for im

3条回答
  •  自闭症患者
    2020-12-05 19:45

    I can confirm this is working well:

    $mb = imap_open("{phoenix.srv.spletnasoba.si:993/imap/ssl/novalidate-cert}","username", "password" );
    
    $emails = array();
    $messageCount = imap_num_msg($mb);
    for( $MID = 1; $MID <= $messageCount; $MID++ )
    {
    
        $EmailHeaders = imap_headerinfo( $mb, $MID );
        foreach($EmailHeaders as $key => $value) {
            if (validateEmail($value)) {
                $emails[$value] = $key;
                echo $value."\n";
            }
        }
    }
    
    
    
    function validateEmail($email) {
        return filter_var($email, FILTER_VALIDATE_EMAIL);
    }
    

提交回复
热议问题