Code Monkey home page Code Monkey logo

php-ews-wrapper's People

Contributors

amirsanni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

php-ews-wrapper's Issues

Tasks not working

Hi,

looks like there's an issue with tasks. It searches for tasks but tries to return contacts.

To solve this, the get function in this file should be sth like:

`public function get(int $page_number=1){
$response = $this->folder->getItems($page_number, DistinguishedFolderIdNameType::TASKS, $this->limit);

    $res = new \stdClass();

    if($response[0]->ResponseClass == ResponseClassType::SUCCESS){
        //format the response by returning specific fields
        $retrieved_tasks = $response[0]->RootFolder->Items->Task;
        $res->tasks = $retrieved_tasks;
        $res->status = 1;
    }

    else{
        $res->msg = $response[0]->ResponseCode.": ".$response[0]->MessageText;
        $res->status = 0;
    }

    return $res;
}`

instead of

` $response = $this->folder->getItems($page_number, DistinguishedFolderIdNameType::TASKS, $this->limit);

    $res = new \stdClass();

    if($response[0]->ResponseClass == ResponseClassType::SUCCESS){
        //format the response by returning specific fields
        $retrieved_contacts = $response[0]->RootFolder->Items->Contact;

        $res->contacts = $retrieved_contacts;
        $res->status = 1;
    }

    else{
        $res->msg = $response[0]->ResponseCode.": ".$response[0]->MessageText;
        $res->status = 0;
    }

    return $res;`

Attachment details not returned

$det->attachments = $msg_info->Attachments && $msg_info->Attachments->FileAttachment ? implode(", ", array_column($msg_info->Attachments->FileAttachment, 'Name')) : "";

There is no properly documented way to retrieve attachments from emails.

The library returns only the name of the attachments without other details. This makes it difficult to retrieve the attachments of an email.

To fix this I modified the referenced line 363 to return the raw attachments as shown below.

$det->attachments = $msg_info->Attachments && $msg_info->Attachments->FileAttachment ? $msg_info->Attachments->FileAttachment : "";

Then other parts of the code that need it manipulate the code as needed with the knowledge of the underlying php-ews to retrieve attachments from email and save them.

Enhancement suggestion on messages

Hi,

currently not all from EWS provided details of messages are returned. E.g. the flag property contains some details like "due date". It would be nice to have this implemented. Alternatively maybe it makes sense to attach all message details to returned object in Message.php

Maybe like this?
$det->details = $msg_info

Forward the email

Hi there!

Is it possible to forward an incoming email to another email address? How can i do this?

Error 401 - Unauthorized when connecting to outlook.office365.com

This was working properly up until this month October.

When it tries to connect to outlook.office365.com, I get the following error:

debug.INFO: array (
'function' => 'processEmailTickets: ews->mail->unread',
'message' => 'SOAP client returned status of 401.',
)

My username and password are correct as I have tested this on a web browser.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.