Receiving mail with PHP
Posted: Sat Jun 05, 2004 8:28 am
I am trying to create a setup where when I send an e-mail to a specific address, a PHP script runs, and parses the e-mail. This should then insert the message, subject, etc into a database then save the attachments into a directory on the webserver.
The web host has already set up the e-mail address to forward to a PHP script, and this works fine. When an e-mail is sent, the script runs. The script though is not a shell script, as the web host does not allow this.
My understanding is that i need the IMAP functions to get the e-mail, parse it, and put a new row into a database with the headers, message, and a link to any attachments, as well as putting the attachment into a folder. The web host has set it up so that the first 500k of the e-mail, and send it to the script via HTTP_POST
This is just about where my understanding of the IMAP finishes. I have tried many scripts, and looked at many tutorials, but cannot get out of them what I need.
If someone could help, it would be much appreciated.
Thanks in advance
Daniel.
The web host has already set up the e-mail address to forward to a PHP script, and this works fine. When an e-mail is sent, the script runs. The script though is not a shell script, as the web host does not allow this.
My understanding is that i need the IMAP functions to get the e-mail, parse it, and put a new row into a database with the headers, message, and a link to any attachments, as well as putting the attachment into a folder. The web host has set it up so that the first 500k of the e-mail, and send it to the script via HTTP_POST
This is just about where my understanding of the IMAP finishes. I have tried many scripts, and looked at many tutorials, but cannot get out of them what I need.
If someone could help, it would be much appreciated.
Thanks in advance
Daniel.