Forum Moderators: coopster
I think (in that I've read about it, but never done it) that it's possible to pipe incoming emails to a PHP script. If it works the way it sounds, every time an email comes in it goes through the script instead of to the mailbox.
- Ryan
I can't seem to get to [procmail.org...] at the moment
Maybe open the mailbox and import anything from it into MySQL every time the user logs in?
that script checks the mailbox and you can give even commands with each email to update existing news and to delete them. this is only the php/pop3 part, nothing with cronjobs or a special mailserver configuration (like the procmail ideas here which do look indeed very cool).
I have created a PHP script to listen to emails.
The moment an email arrives to the server, it generates an HTML page containing the email contents.
I have also tried inserting the email content to MySQL.
You have 2 options.
1. Email piping.
2. Cronning an imap function to check email every now and then.
So in this instance, the email (in its entirety with heads and all) would be sent as a parameter to the PHP script and could be handled accordingly. No need to run a cron job or build/install any code that would check a POP3 or IMAP account. This is probably as close as you can get to directly emailing a PHP script.. so your PHP script in essence becomes the direct recipient of the email.
That might be useful especially since it has a lot of user comments added in as well.