Comments (11)
Why don't you just pull...?
from php-imap.
Hi
I'm a bit new to all these terms (pull, fork, etc).
Do you mean get your source and write it myself and contribute back? I've
been thinking about it...
Best
Mark
On Wed, Jun 11, 2014 at 5:40 PM, thailemon [email protected] wrote:
Why don't you just pull...?
—
Reply to this email directly or view it on GitHub
#57 (comment).
from php-imap.
@tetrode Yes, just make a fork, commit your changes, and proceed pull request. There is a lot information in Google how to do this :) Right now I don't have enough free time to do this by myself.
from php-imap.
Thanks, I will surely find this on google!
On Wed, Jun 11, 2014 at 5:45 PM, Sergey [email protected] wrote:
@tetrode https://github.com/tetrode Yes, just make a fork, commit your
changes, and proceed pull request. There is a lot information in Google how
to do this :)—
Reply to this email directly or view it on GitHub
#57 (comment).
from php-imap.
@tetrode Hi,
I too am using this library but now looking to implement imap idle in it.If you have made any progress kindly let me know.
Regards,
Zeeshan.
from php-imap.
Hi Zeeshan
I have been looking into the IDLE / NOTIFY extension of the IMAP protocol.
It works basically as follows:
-> telnet to IMAP server
-> login with user, password
-> say IDLE to the remote server
-> wait in a blocking get
-> when new mail comes in, the server will inform you
Due to this blocking get (you never know when the next e-mail is coming in)
this is not suitable for php scripts that run in a web browser.
It can serve in a php script that runs as a daemon (this is how I will use
it).
I have a semi working script here, you can use the code - no license
attached :-)
Best
Mark
On Wed, Aug 13, 2014 at 3:22 PM, Zeeshan [email protected] wrote:
@tetrode https://github.com/tetrode Hi,
I too am using this library but now looking to implement imap idle in
it.If you have made any progress kindly let me know.Regards,
Zeeshan.—
Reply to this email directly or view it on GitHub
#57 (comment).
from php-imap.
Thanks Mark.
Will surely give it a try.
On Wed, Aug 13, 2014 at 9:00 AM, tetrode [email protected] wrote:
Hi Zeeshan
I have been looking into the IDLE / NOTIFY extension of the IMAP protocol.
It works basically as follows:-> telnet to IMAP server
-> login with user, password
-> say IDLE to the remote server
-> wait in a blocking get
-> when new mail comes in, the server will inform youDue to this blocking get (you never know when the next e-mail is coming
in)
this is not suitable for php scripts that run in a web browser.It can serve in a php script that runs as a daemon (this is how I will use
it).I have a semi working script here, you can use the code - no license
attached :-)Best
Mark
On Wed, Aug 13, 2014 at 3:22 PM, Zeeshan [email protected]
wrote:@tetrode https://github.com/tetrode Hi,
I too am using this library but now looking to implement imap idle in
it.If you have made any progress kindly let me know.Regards,
Zeeshan.Reply to this email directly or view it on GitHub
#57 (comment).Reply to this email directly or view it on GitHub
#57 (comment).
from php-imap.
Dear tetrode,
I am also looking for the same thing, did you get it, if yes then please share with me ?
Regards
Pankaj
from php-imap.
I have been looking into the IDLE / NOTIFY extension of the IMAP protocol.
It works basically as follows:
-> telnet to IMAP server
-> login with user, password
-> say IDLE to the remote server
-> wait in a blocking get
-> when new mail comes in, the server will inform you
Due to this blocking get (you never know when the next e-mail is coming in)
this is not suitable for php scripts that run in a web browser.
It can serve in a php script that runs as a daemon (this is how I will use
it).
I have a semi working script here, you can use the code - no license
attached :-)
Best
Mark
On Sep 12, 2014 12:16 PM, "pguptaoctal" [email protected] wrote:
Dear tetrode,
I am also looking for the same thing, did you get it, if yes then please
share with me ?Regards
Pankaj—
Reply to this email directly or view it on GitHub
#57 (comment).
from php-imap.
As already stated: This is not possible for PHP scripts, which runs on a web server.
You can build such a functionality by using the PHP functions imap_ping
and imap_check
for PHP scripts, which will be executed on the CLI (as a daemon).
All PHP IMAP functions can be called / used by php-imap
like this:
$mailbox->imap('ping');
$mailbox->imap('check');
Below an untested example code:
RECONNECT:
// Connect to mailbox
$mailbox = new PhpImap\Mailbox('{imap.gmail.com:993/imap/ssl}INBOX', '[email protected]', '*********', __DIR__);
CHECKMAILS:
// Search unseen (unread) mails
$mailsIds = $mailbox->searchMailbox('UNSEEN');
if(!$mailsIds) {
echo 'Mailbox is empty. Waiting 60 seconds until next check...\n';
sleep(60);
// Clear IMAP cache to prevent high memory consumption
$mailbox->imap('gc', array(IMAP_GC_ELT));
if(!$mailbox->imap('ping')) {
goto RECONNECT;
}
$mailbox_check = $mailbox->imap('check');
if($mailbox_check->Recent > 0) {
echo 'New emails arrived. Parsing them...\n';
goto PARSEEMAILS;
}
}
// Parse emails
PARSEEMAILS:
foreach($mailsIds as $mailId) {
$mail = $mailbox->getMail($mailId);
// Do something with $mail; eg. saving to database, sending autom. responses, ...
}
// Go back and check for new emails
goto CHECKMAILS;
Please note, that you should add a logic to restart the PHP script after some time.
References:
from php-imap.
@Sebbo94BY: Could you update your example code, as $mailbox->imap('ping');
does not work any more because the imap-function got removed (refactored?) in commit dab9937 ? Thanks :)
from php-imap.
Related Issues (20)
- [Feature Request] I Want to All Email in Directory and Spam Directory
- [Feature Request] Add Origin-MessageID header
- Couldn't open stream
- PHP Fatal error: Uncaught Error: Call to protected method PhpImap\Mailbox::disconnect()
- I need solution for convert emails to ticket
- Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Invalid credentials (Failure)PHP Notice: Unknown: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Invalid credentials (Failure) (errflg=2) in Unknown on line 0
- ConnectionException "LOGIN failed." with office 365 since Microsoft activated two factor auth HOT 2
- [Feature Request] Add bool return to setFlag(), markMailAsRead(), etc. HOT 2
- fetch_overview does not allow select range with * HOT 1
- [BUG] Embeded images get replaced nok HOT 1
- [BUG] Processing ENCBINARY encoding returned base64 string
- [BUG] For some emails, the body is empty HOT 3
- Error Handling Not working
- where is vendor folder HOT 7
- [BUG] Mark as Seen boolean not working on getMail() HOT 1
- imap_fetchheader(): UID does not exist HOT 2
- [Feature Request] Save email to eml file
- SEEN SINCE Issue
- OFFICE 365 - Connection HOT 1
- [BUG] Truncated Attachment Names Resulting in Lost File Extensions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-imap.