I've seen some posts on EE about pipe scripts that can receive an e-mail and saved it to a database, but I have not been able to understand exactly how to do it. I'm using PHP 5 and MySQL 5 on a Unix (FreeBSD) server.
Here's the scenario of what I need to do:
The user receives an e-mail in Outlook. It relates to a certain sales account, so he wants to store it in a MySQL database record relating to that sales account.
He clicks "forward" and puts in a special e-mail address (that leads to the PHP script). And he puts the account number as the first thing in the subject line.
When the forwarded mail reaches that special PHP-connected address, the PHP script reads the account number from the subject line, so it knows what account to save it to.
PHP saves the message body and any attachments into MySQL (presumably the message body would be saved to a text field, and any attachments would be saved to BLOB fields?).
This is a standard Unix server with PHP as an Apache module. It is a commercially-hosted shared server, so I don't have a lot of control over special settings.
Please explain _in detail_ how to accomplish this. I'm offering maximum points, as I need a full, detailed explanation and would appreciate sample code.