|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Extract email with PHP
I'm hosting on Ipowerweb and I want to try something new (at least new to me). I recently got a camera phone, and I would like to email pictures I take to a certain email I have with ipowerweb. What I need help with, is pulling the picture from the email to put on my home page using PHP. I know Ipowerweb uses Sendmail and I know the path to it, but that's about all. Any help you guys can lend would be very appreciated. Thanks
|
|
#2
|
|||
|
|||
|
Hi I had the same idea and am working on this.
I have worked out how to 'pipe' an email to a script and to disect all the parts of the email and store them into a database. HERE IS SOME INFO ON PIPING TO A SCRIPT URL ( I have 'cpanel' installed on my server which makes it very easy to do - you just have to make a forwarder to "php |/path/to/the/script") Really I need to know how to create that image from the raw text of the email and save that as an image on the webserver, and create a link field in the database which points to that URL or image name. That is where I am stuck at the moment. (the image recreation). I cannot really put any code here yet as it's all up in the air. My first attempt was to pipe the email directly into the script then filter all the parts I needed out - but found this too hard. My second technique was to pipe the email to a script and also to an alternate email address. Piping the email to the script caused it to run, and the script then downloads the pop mail and decodes it (This is much easier than filtering the email) and stores the relevant bits into a database. Does anyone know how to turn this data (below) back into a .jpg file. (I think it's something like using this function URL) /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAZAAA/+4ADkFkb2JlAGTAAAAAAf/b AIQAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgIC AwMDAwMDAwMDAwEBAQEBAQECAQECAgIBAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD AwMDAwMDAwMDAwMDAwMDAwMD/8AAEQgAMABAAwERAAIRAQMRAf/EAKAAAAICAwEAAAAAAAAAAAAA AAcJBQgEBgoBAQACAgMBAQAAAAAAAAAAAAAFBgQHAAEDCAIQAAECAwMHBwgIBwAAAAAAAAUEBgAB By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Hu giiR2xTokZf/AKtQ3IWPLV5zml5fT5Yl8p7fCCnzfu3CUfm2Uef74cdBmvT9mnnQQVIHt+mBpQh/ zssstTzw74ez6rVCI9eRUZwLLFeMRqjluD+DXbrGjXcKH8+X0ZYiM+1eVBa8RWxSTblfmrUBaqHp 0q4WoS9qVLfp054lzHZ/Ko2Kopl33IbT+8UqLuNhPjWtgS1bZIY9L8AIDHFrnNltivcbd2zUdsa+ VQc03GqVUX78MN+qCDw8/EDbdDXSrW0LcDgGD3C15y3OYxHbN8T++RfLNnFWou9mzucVuIGptOb6 oAtm8P49+HyneS1+PxF+oMQHd8LJ/wAHvgxAmzxUn0cqfMMktiXkxGNwQOOk7VSt8Oe8ZDxeJb0W /wCvuDeJTXJc8CEwRI1LRDaalOPMwucreDYE7Hv/AG+oKEu0JbFSXJ6rIVHq2w6GIuZ2rqEuy5x/ TPTl+uHfD3hV2e6HN3Xgqhb85h07Xx7HjxIKL1LDMg2zvfbI9o8mt0p6ESGA23LgqPv0rhUJcBDq iA1F3aU3kQz74MeZHCn3IZ2zFZEeGfyv3HIcOXDZ+77PS1AfCVAqb6mWNM0Utz4gPxEP4k/rI84d q8btnWJg1mGYfw8OW+o8+K4U/FzpfcMNpHkzX3KzXkZxQgQGt+3U+xyn2OLBmMQ6r0f9iWFjfeCK tfWC+FJKc3DHBqfbql5RwOheSNOg8a7wJECG2LPycRkgUzZ2sScwzD+zcAr3C64IXCouQ7Olw2aV Ki+HkOx+mcTdwlFTeO7gDYHHRTrBx553UbrOBQa5TmttPiRQe4BufdDv3gHm5GJOc7YTXf5flWVV F9laKmzXzSiVqq0qirp5+VKLJaTFsTecFb/qr8wrhfru/OH9wcQVaWxUel7tJMsollUh0YfsHvhH Ix7nMdsRxHZRFfOG0Ud3iRUnFH//2Q== |
|
#3
|
|||
|
|||
|
I also just found this entry about 'simsi' which I am looking into
THE ENTRY ON THIS SITE SIMSI WEBSITE ![]() |
|
#4
|
||||
|
||||
|
It'll be base64 or similar encoded. Try base64 decoding it...
It should give you the START and END somewhere so you'll know what part is teh attachment. Maybe PHP has a function for extracting attachments? |
|
#5
|
|||
|
|||
|
My solution
I found a way to do what I wanted, but not quite in this fashion. Here is a site that does something similar to what I wanted. I've reverse engineered it alittle and his method of getting the pictures is pretty ingenius. The simplest answer, which he did, is to log into the email account and get the pictures that way. It just has to be scheduled as a cron on the server. This way, you don't have to worry about accessing email files on the server, you can even have your email account through some where else completely. If anyone wants to know any more about this, let me know.
|
|
#6
|
|||
|
|||
|
Quote:
I've been getting quite a few emails about this post, so let me explain it a bit better. The easyblog site I linked above uses pop3 classes that check your inbox for messages, process them, then delete them. Everything is done from the batch file, which just requires the other files. You can download their code and work you way through it, or you can download the code from my site. The code on my site has been stripped down to only strip the email of the picture. I use my own blogging system. You can download the fileshere, and see my implementation here. If you have any questions, please feel free to email me at bishopATwebclutter.com |
![]() |
| Viewing: Dev Shed Forums > System Administration > Mail Server Help > Extract email with PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|