Has anybody achieved this before or knows of a way to do so? I understand there may be some manual work on the users side but I'm not sure how possible/easy it would be. I thought maybe use fsockopen to connect to a mailserver and retrieve e-mails, but I can see trouble arising.
Regards,
Importing Outlook Express / Thunderbird emails to PHP
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I still recommend using a system_filter with Exim4 and piping incoming mail directly through a PHP script at SMTP time. It's just a shame hosts don't offer users their own system_filter files. Exim4 does support this, and CPanel runs with Exim4, but it's not configured that way.
I do this quite a lot. We have an incoming mail server at work which I've set up to store mail in a database linked with users in our system. I also used to use this technique to log border-line spam in a DB. I'm also about to write one to keep track of PayPal payments as the emails get sent to me. It's not difficult if you have access to the Exim configuration, or if your host provide user-level Exim configuration.
I do this quite a lot. We have an incoming mail server at work which I've set up to store mail in a database linked with users in our system. I also used to use this technique to log border-line spam in a DB. I'm also about to write one to keep track of PayPal payments as the emails get sent to me. It's not difficult if you have access to the Exim configuration, or if your host provide user-level Exim configuration.
-
impulse()
- Forum Regular
- Posts: 748
- Joined: Wed Aug 09, 2006 8:36 am
- Location: Staffordshire, UK
- Contact:
I'm not going to be doing this as originally planned. Now I will be using an e-mail parsing class to parse an uploaded .EML file. Most of this is going well at the moment, I'm able to extract the from, to & subject information from the .EML file but I'm clueless on how to extract the attachment data from the .EML file. Can somebody throw a suggestion at me please.
Regards,
Regards,
-
impulse()
- Forum Regular
- Posts: 748
- Joined: Wed Aug 09, 2006 8:36 am
- Location: Staffordshire, UK
- Contact:
I'm using a parser class from phpclasses.org named MIME e-mail parser. I have read through the brief documentation that came with the class but it doesn't explain how to parse the attachment. The parser can see the attachment filename but I'm not sure how I would handle the attachment to save it to a location.
Regards,
Regards,
It seems you have run the example script without changing it. In that case you need to change the parameters array, comment the SkipBody parameter and uncomment the SaveBody parameter setting it to the directory where you want to the message body part files to be saved.impulse() wrote:I'm using a parser class from phpclasses.org named MIME e-mail parser. I have read through the brief documentation that came with the class but it doesn't explain how to parse the attachment. The parser can see the attachment filename but I'm not sure how I would handle the attachment to save it to a location.
If you leave the SaveBody parameter commented out, the message body parts are returned in the message decoded array as strings. This is not good for large messages as it may exceed the PHP memory limit.
Anyway, for more questions about the MIME parser class, please use the its package specific forum in the PHP Classes site.