Giter VIP home page Giter VIP logo

php-imap-messages-fetcher's Introduction

PHP IMAP

Retrieve messages from an IMAP server

Usage example:

$imap = new Imap();
$connection_result = $imap->connect('{imap.gmail.com:993/imap/ssl}INBOX', '[email protected]', 'password');
    if ($connection_result !== true) {
        echo $connection_result; //Error message!
        exit;
    }
$messages = $imap->setLimit(10)->getMessages('text', 'asc'); // Return array of messages. Second parameter is for type of sort desc|asc

in $attachments_dir property set directory for attachments

in the __destructor set errors log file

If you use gmail must allow - https://support.google.com/accounts/answer/6010255?hl=en

Dependencies

php-imap
Installations:
MacOS: brew install kabel/php-ext/[email protected] (php 7.2 in this example)
Ubuntu: sudo apt install php7.2-imap

Donate

If this project help you reduce time to develop, you can give me a cup of coffee to continue its development. Thank you! :) Donate

php-imap-messages-fetcher's People

Contributors

kirilkirkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

php-imap-messages-fetcher's Issues

apache force close

Dears @kirilkirkov ,
I have 2 issues and need your help for imap.class.php functions.

First,
Apache force close any time while the application refresh continuously when we're add attachments folder for attachment download, and run normally when it's folder deleted.
any advice for this issues ?

Second,
Email Inbox too slow when its load about 100 inbox messages, and failed to load more than 1000 messages.
any idea for this issues and make it faster?

Thanks,

Uncaught Error: Call to undefined function imap_open()

Hey I recently tried to use your Code in combination with the video: https://www.youtube.com/watch?v=xFQxTB0awiU.
After I typed everything correctly in (In my Opinion), I got an Error:

Fatal error: Uncaught Error: Call to undefined function imap_open() in C:\xampp\htdocs\Email-Inbox-IMAP-master\lib\class.imap.php:28 Stack trace: #0 C:\xampp\htdocs\Email-Inbox-IMAP-master\index.php(13): Imap->connect('{imap.gmail.com...', '[email protected]...', 'mypassword') #1 {main} thrown in C:\xampp\htdocs\Email-Inbox-IMAP-master\lib\class.imap.php on line 28

I don't know how to solve the error.

My Project:
Email-Inbox-IMAP-master.zip

PS:
I replaced my gmail with a another gmail address and password ([email protected]; mypassword)

Thank you in advance

how to sort

thanks for the class.
how can I see the last message first?
ASC or DESC

How to get CC'ed emails?

Hi,

Great little plugin that works perfectly. I just wanted to know how can I retrieved who has been CC'ed in the email?

Thank you
Parth

Don't know how to save attachments

I have problems with saving attachments. My attachments doesn't save to directory and i print_r $messages out, it doesn't show attachments there either.

[attachments] => Array
(
)

Error handle

public function connect($hostname, $username, $password) {

    $connection = imap_open($hostname, $username, $password) or die('Cannot connect to Mail: ' . imap_last_error());
    if (!preg_match("/Resource.id.*/", (string) $connection)) {
        return $connection; //return error message
    }

Error message cant be returned because of "or die" in imap_open

Return encoded data

Email body and attachment both return encoded data if mail contain .eml extension as attachment

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.