Hướng dẫn imap php extension xampp

I am installing a CRM locally and I have a problem with IMAP. I am looking for and find that "extension = imap" must be enabled, but I do it and it remains the same.

Show

    Notice that I am using xampp in Windows 10.

    Hướng dẫn imap php extension xampp

    I thank you in advance

    asked Feb 1, 2020 at 4:32

    Hướng dẫn imap php extension xampp

    1

    You need to configure your php.ini file to enable IMAP extension

    Search for the line ;extension=php_imap.dll and remove semicolon(;) and restart your xampp. The line should look like as mentioned below.

    extension=php_imap.dll

    answered Jul 16, 2020 at 7:26

    Hướng dẫn imap php extension xampp

    vkramsvkrams

    7,00717 gold badges76 silver badges126 bronze badges

    1

    Update

    New php version does not have dll anymore.

    Steps

    1. Access your php.init file. [xampp\php\php.init]
    2. Remove the semicolon(;)
    3. Restart your xampp.

    Demo

    Image: https://prnt.sc/tu6frh

    ;extension=imap -> extension=imap
    

    answered Aug 5, 2020 at 1:53

    Hướng dẫn imap php extension xampp

    Open your php.ini file to enable IMAP extension

    Search for the line ;extension=imap and remove semicolon(;) and restart your xampp.

    extension=imap
    

    answered Jul 24 at 9:11

    Hướng dẫn imap php extension xampp

    For all the people coming here praying for:

    1) a dead-easy way to read MIME attachments, or
    2) a dead-easy way to access POP3 folders

    Look no further.

    function pop3_login($host,$port,$user,$pass,$folder="INBOX",$ssl=false)
    {
       
    $ssl=($ssl==false)?"/novalidate-cert":"";
        return (
    imap_open("{"."$host:$port/pop3$ssl"."}$folder",$user,$pass));
    }
    function
    pop3_stat($connection)       
    {
       
    $check = imap_mailboxmsginfo($connection);
        return ((array)
    $check);
    }
    function
    pop3_list($connection,$message="")
    {
        if (
    $message)
        {
           
    $range=$message;
        } else {
           
    $MC = imap_check($connection);
           
    $range = "1:".$MC->Nmsgs;
        }
       
    $response = imap_fetch_overview($connection,$range);
        foreach (
    $response as $msg) $result[$msg->msgno]=(array)$msg;
            return
    $result;
    }
    function
    pop3_retr($connection,$message)
    {
        return(
    imap_fetchheader($connection,$message,FT_PREFETCHTEXT));
    }
    function
    pop3_dele($connection,$message)
    {
        return(
    imap_delete($connection,$message));
    }
    function
    mail_parse_headers($headers)
    {
       
    $headers=preg_replace('/\r\n\s+/m', '',$headers);
       
    preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)?\r\n/m', $headers, $matches);
        foreach (
    $matches[1] as $key =>$value) $result[$value]=$matches[2][$key];
        return(
    $result);
    }
    function
    mail_mime_to_array($imap,$mid,$parse_headers=false)
    {
       
    $mail = imap_fetchstructure($imap,$mid);
       
    $mail = mail_get_parts($imap,$mid,$mail,0);
        if (
    $parse_headers) $mail[0]["parsed"]=mail_parse_headers($mail[0]["data"]);
        return(
    $mail);
    }
    function
    mail_get_parts($imap,$mid,$part,$prefix)
    {   
       
    $attachments=array();
       
    $attachments[$prefix]=mail_decode_part($imap,$mid,$part,$prefix);
        if (isset(
    $part->parts)) // multipart
       
    {
           
    $prefix = ($prefix == "0")?"":"$prefix.";
            foreach (
    $part->parts as $number=>$subpart)
               
    $attachments=array_merge($attachments, mail_get_parts($imap,$mid,$subpart,$prefix.($number+1)));
        }
        return
    $attachments;
    }
    function
    mail_decode_part($connection,$message_number,$part,$prefix)
    {
       
    $attachment = array();

        if(

    $part->ifdparameters) {
            foreach(
    $part->dparameters as $object) {
               
    $attachment[strtolower($object->attribute)]=$object->value;
                if(
    strtolower($object->attribute) == 'filename') {
                   
    $attachment['is_attachment'] = true;
                   
    $attachment['filename'] = $object->value;
                }
            }
        }

        if(

    $part->ifparameters) {
            foreach(
    $part->parameters as $object) {
               
    $attachment[strtolower($object->attribute)]=$object->value;
                if(
    strtolower($object->attribute) == 'name') {
                   
    $attachment['is_attachment'] = true;
                   
    $attachment['name'] = $object->value;
                }
            }
        }
    $attachment['data'] = imap_fetchbody($connection, $message_number, $prefix);
        if(
    $part->encoding == 3) { // 3 = BASE64
           
    $attachment['data'] = base64_decode($attachment['data']);
        }
        elseif(
    $part->encoding == 4) { // 4 = QUOTED-PRINTABLE
           
    $attachment['data'] = quoted_printable_decode($attachment['data']);
        }
        return(
    $attachment);
    }
    ?>

    [EDIT BY danbrown AT php DOT net: Contains a bugfix by "mn26826" on 09-JUN-2010, which fixed the erroneous reference to $imap as the parameter passed to imap_mailboxmsginfo() within the user function pop3_stat().  This was intended to be $connection.]

    [EDIT BY visualmind AT php DOT net: Contains a bugfix by "elias-jobview" on 17-AUG-2010, which fixed the error in pop3_list function which didn't have: return $result]

    [EDIT BY danbrown AT php DOT net: Contains a bugfix by "chrismeistre" on 09-SEP-2010, which fixed the erroneous reference to $mbox (should be $connection) in the pop3_list() function.]