Get addressbook contact picture



  • Hello,

    how can i get the contact picture in the addressbook of some contacts?

    My Code:

    // Open addressbok
    if (!$abEntry = mapi_msgstore_openentry($publicStore, hex2bin(FOLDER_ENTRYID))) {
    	errExit('Cannot open addressbook by ENTRYID!');
    }
    
    // Query entryid:
    $message = mapi_msgstore_openentry($publicStore, $contactEntryID);
    if (!$message) {
    	errExit("Cannot get entryid");
    }
    
    // Get attachments
    $attachmentTable = mapi_message_getattachmenttable($message);
    $attachmentData = mapi_table_queryallrows($attachmentTable);
    

    I can read all attachments of a contact, but how to know, which attachment ist the contact picture?

    Please help me!


  • Kopano

    Hi @dbgtmaster ,

    briefly talked to a developer about this and the attachment in questions contains the property PR_ATTACHMENT_CONTACTPHOTO

    0_1501509608563_Image+Pasted+at+2017-7-31+17-38.png

    I’m curious. what are you developing? We have some external plugins and project listed at https://stash.z-hub.io/projects/COM/repos/projects-and-resources/browse, maybe you want to add your project later as well.



  • Hi,

    thanks for your response, i try it.
    I develop a script for my asterisk, which query the incoming call number to a public addressbook and displays the name and photo, if availble.


Log in to reply