Re: Handling Incoming Email Attachments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nirmal Jayasinghe wrote:
hello all,

I'm trying to figure out a way to manipulate incoming email attachments with
PHP. There'll be a special email address to which the emails with the
attachments would be sent, with a number specified in the subject line. What
I need to do is to grab the attachment (a photo), rename it with the number
specified in the subject line, and move it onto a specific folder on the Web
server [which will be running LAMP].

I couldn't find any online material describing how to manipulate incoming
mail attachments. Can someone give an idea?
Hi,

For handling e-mail in all their sorts (believe me, it is hell), I found the PECL mailparse the best solution. It can find the attachments and their MIME-types in a snap. And all the headers are separated too.

You only have to wrap functions around it to do what you want to do.

Be sure to validate the attachments and do not rely on the MIME-type only. People can spoof that kind of files.
--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other....'/

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux