jamesiarmes/php-ews

Message failed to create with "ErrorInvalidPropertySet: Set action is invalid for property."

l0ckm4 opened this issue · 1 comments

I am using php-ews to send simple emails already but I want to add in inline attachements to one of the emails. I followed the example at https://github.com/jamesiarmes/php-ews/blob/master/examples/message/create-inline-attachment.php but cannot use

$attachment->Content = $file->openFile()->fread($file->getSize());

due to my php version - 5.4.45 So, I replaced the line with

$attachment->Content = file_get_contents($file->getPathname());

but get the following error :-

Message failed to create with "ErrorInvalidPropertySet: Set action is invalid for property."

Can anyone help me please?

EDIT

I have now tried it on a new server running php7.3 with the original code but yet I still get the error.
I am running Exchange 2010 so have the version set to :-
$version = Client::VERSION_2010;

I fixed the same issue by specifying the service pack version.

$version = Client::VERSION_2010_SP2;