Attachment Functions — This section describes functions which are performed on MAPI Attachment objects.
string mapi_attach_openbin(mapiattach $attach,
long $proptag);
mapimessage mapi_attach_openobj(mapiattach $attach,
long $flags);
string mapi_attach_openbin(mapiattach $attach, long $proptag
Read binary contents of attachment
Retrieves the actual attachment data in the attachment when the attachment has PR_ATTACH_METHOD is 1 (ATTACH_BY_VALUE). Returns a binary string on success, FALSE on failure.
Example 3.55. Getting attachment data
// Open attachment number 0 $attach = mapi_message_openattach ($message, 0); // Output attachment data print(mapi_attach_openbin($attach, PR_ATTACH_DATA_BIN));
mapimessage mapi_attach_openobj(mapiattach $attach, long $flags
Read message contents of attachment
Returns a message object which is embedded in an attachment. This can be done for attachment which have PR_ATTACH_METHOD 5 (ATTACH_EMBEDDED_MSG). Returns a mapimessage object on success, FALSE on failure.
Bitmask of flags that controls access to the property. The following flags can be set:
If the property does not exist, it should be created. If the property does exist, the current value of the property should be discarded. When a caller sets the MAPI_CREATE flag, it should also set the MAPI_MODIFY flag.
Requests read/write access to the property. The default access is read-only. MAPI_MODIFY must be set when MAPI_CREATE is set.
Example 3.56. Getting the attachment message
// Open attachment number 0 $attach = mapi_message_openattach($message, 0); // Open embedded message $message = mapi_attach_openobj($attach); // Show message contents print_r(mapi_message_getprops($message);