Author |
|
leevee Newbie
Joined: 22 February 2017 Location: South Africa
Online Status: Offline Posts: 3
|
Posted: 22 February 2017 at 1:46am | IP Logged
|
|
|
Hi
I am using your API to retrieve messages.
I have used your example in "Getting New or Last Messages" exactly, but i get the error;
Fatal error: Call to undefined method CApiMailMessage::From()
I can number of unread messages and folders etc perfectly fine, it's only when trying your above example.
It bombs out looking for this method;
$oFrom = $oMessage->From();
as well as;
$oMessage->Uid(),$oMessage->Subject()
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 22 February 2017 at 2:10am | IP Logged
|
|
|
From and Subject are properties, not methods. Hence, the values need to be retrieved as follows:
Code:
$oFrom = $oMessage->From;
$sSubject = $oMessage->Subject; |
|
|
If you prefer using methods, you can use these:
Code:
$oFrom = $oMessage->GetFrom();
$sSubject = $oMessage->GetSubject(); |
|
|
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
leevee Newbie
Joined: 22 February 2017 Location: South Africa
Online Status: Offline Posts: 3
|
Posted: 22 February 2017 at 3:39am | IP Logged
|
|
|
Thanks Igor!
The method way using the get in front worked a charm.
(For some reason the first way doesn't work.)
I can work with it like that
Another question: Is there any way to receive attachments with this API??
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 22 February 2017 at 4:05am | IP Logged
|
|
|
Quote:
(For some reason the first way doesn't work.) |
|
|
My mistake, sorry, those properties are protected and cannot be used from outside the class.
Quote:
Is there any way to receive attachments with this API? |
|
|
No that's not currently supported by PHP API, you would need to use Web API for that:
Web API / Receiving mail / MessageGet
Once you get information about the message, it will contain Attachments item with hashes provided for each of the attachments, that's all you need to get attachments content. The documentation page shows how to build a link for retrieving a particular attachment item.
Hope this helps.
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
leevee Newbie
Joined: 22 February 2017 Location: South Africa
Online Status: Offline Posts: 3
|
Posted: 22 February 2017 at 4:16am | IP Logged
|
|
|
great.
Thanks for your help!
|
Back to Top |
|
|