Page 1 of 1

Email to database

Posted: Fri Aug 31, 2007 8:04 pm
by aceconcepts
Hi,

Can anyone point me in the right direction for retrieving my emails into a MySQL database?

I have a script that I send emails from using PHP mail() and would like to store the replies to sent messages in the same database and not really have to open Outlook to read them.

I've tried looking for some examples and tutorials but "emails" and "php" returns a vast amount of info in a search engine.

Anyway, I hope someone knows of a good example/tutorial.

Thanks.

Posted: Fri Aug 31, 2007 9:22 pm
by califdon
As far as I know, you would probably have to code some very low level operations to connect to a POP3 mail server and then you would probably be flooded with spam. I don't think I would even try.

Posted: Sat Sep 01, 2007 10:50 am
by anjanesh
Actually its very easy if your hosting control panel allows you to forward emails of an account to a script that can be executed in command-line.
CPanel has an option to forward a mail to a script. Forwarders > Add > Pipe to a Program. So you probably would get ton of results specific to Cpanel powered hosts/sites.

Read this article if you're having root access.
I've tried looking for some examples and tutorials but "emails" and "php" returns a vast amount of info in a search engine.
Search for pipe email. Keyword is pipe.

Posted: Sat Sep 01, 2007 10:54 am
by Begby
If you aren't using cpanel you can just use the imap commands to login to a pop or imap email account and download mail then you could store it into a database.

http://us3.php.net/manual/en/ref.imap.php

Posted: Sat Sep 01, 2007 5:01 pm
by aceconcepts
Superb.

I have root access using php myadmin.

Thanks for your help.