I don't want to use shell script to read mail on the server. I try to use PHP script to read that mail. Is it possible? If it's possible, how can I start to do?
I know a little about shell script.
please give me the link or code to start with.
I don't want to use shell script to read mail on the server. I try to use PHP script to read that mail. Is it possible? If it's possible, how can I start to do?
I know a little about shell script.
please give me the link or code to start with.
Yes you can do it in PHP. It depends on which way u need it. This link explains creation of mail client in PHP http://www.devshed.com/c/a/PHP/Building-A-PHPBased-Mail-Client-part-1/
At some point I wanted to check if there was any unread messages in a couple mailboxes from inside an website administration panel, so I ended up with a simple script like the one described here. What we want is to fetch the all the messages in the INBOX of each e-mail account for the past week, using the IMAP functions of PHP. Also, we are going to mark the unread messages with a different style.
http://www.backslash.gr/content/blog/webdevelopment/8-check-your-email-with-php-and-imap
I also wrote a blog post on this subject a while back. Sometimes using pop or imap might not be desirable, my blog was for Rails but the different options and principals still all apply.
The post shows a number of methods including polling, piping directly into your app when a message is received, using curl and third party solutions that don't require you're own mail server.