0

How would one retrieve emails from an email server and put them into a mysql database?

Idealistically sticking with php. But could incorporate another language if needed.

Adam
  • 723
  • 10
  • 22

2 Answers2

2

Yes, there's.

If you're using a hosting solution with cPanel. You should take a look at

http://www.webmasters-central.com/article-blog/tutorials/email-pipe-tutorial-setting-up-email-piping/

http://devtrench.com/posts/simple-email-logger-using-cpanels-pipe-forwarder

(useful for php scripts)

If you're using a Postfix solution take a look at

https://serverfault.com/questions/258469/how-to-configure-postfix-to-pipe-all-incoming-email-to-a-script

http://evolt.org/incoming_mail_and_php?from=50

You should look for "piping email to php" or "piping email to python" or what the language you're using on google.

Anyway, with PHP or Python you can achieve that, getting your incoming email to a DB.

Community
  • 1
  • 1
P. R. Ribeiro
  • 2,999
  • 1
  • 19
  • 20
-1

Here is the whole class which can help you do this i have used it and its working

http://www.phpclasses.org/package/3324-PHP-Retrieve-e-mail-messages-into-a-MySQL-database.html

further you can get help from PHP email to mysql database issue when not deleting emails from server

see the code he used, its is done by imap_open also see this

http://php.net/manual/en/function.imap-open.php

Community
  • 1
  • 1
Syed Raza Mehdi
  • 4,067
  • 1
  • 31
  • 47
  • 1
    Note that [link-only answers](http://meta.stackoverflow.com/tags/link-only-answers/info) are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference. – kleopatra Oct 22 '13 at 11:54
  • thanks dear kleopatra i will take care of this suggestion next time – Syed Raza Mehdi Oct 22 '13 at 11:58
  • Unfortunately without fixing this answer (per kleopatra's suggestion) the links alone arent useful and require further registration/login at other websites to even test if the answer is accurate. – Tarquin Jul 28 '22 at 00:19