I'm trying to figure out a way to do the following with php:
Have a website (index.php) check an e-mail inbox every 15 seconds or so, read the subject line, and the contents of the message, and then display that message on the screen. The idea being it will display all the messages in the inbox on the index.php page as they get sent in. And I guess the index.php page will also have to refresh whenever there is a new message to display the content.
Thanks!
I think an interval of less than a minute is rather difficult to realize and/or rather expensive to run. If you need that high a frequency, you should be better off by writing a hook for your mail handler that gets triggered whenever new mail arrives. How to do that depends on your mail handler.
Bad idea. If your page refreshes every 15 seconds, nobody will ever be able to click on anything because as soon as the page refreshes, it will start refreshing again.
What you probably want is something more ajaxy, like gmail uses. This does the refresh in the background so the page itself doesn't refresh. There are lots of tutorials on how to do this. For example This , which you can extrapolate out to what you want.
Dump the email contents into a database or some kind of flat file and use its contents to display.
If your using gmail: http://framework.zend.com/download/gdata
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.