-1

I have following MySQL database structure:

  id |       from      |     content     |    attachment   | datestamp
 ---------------------------------------------------------------------
  1  | sender@mail.com | [BLOB - 4,6 KB] | img20120605.jpg | NOW()

I would like to automatically save all incoming emails to that database and copy image from attachment to server. Is it possible? Is there any library or tool which will help me to achieve this?

Aaron W.
  • 9,254
  • 2
  • 34
  • 45
user1292810
  • 1,702
  • 7
  • 19
  • 38
  • 1
    What tool or library shoud I use for it? – user1292810 Jun 05 '12 at 10:52
  • 2
    possible duplicate of [How to get emails and save them into mysql database](http://stackoverflow.com/questions/6520666/how-to-get-emails-and-save-them-into-mysql-database) – eggyal Jun 05 '12 at 10:55
  • possible duplicate of: [How do I receive email and process it in a web application](http://stackoverflow.com/questions/965178/how-do-i-receive-email-and-process-it-in-a-web-application) – hakre Dec 24 '14 at 11:31
  • This question could do with being deleted - it has a LQ upvoted answer and so doesn't qualify for automatic removal ("Roomba"). I have cast a delete vote. – halfer Apr 16 '20 at 15:25

1 Answers1

2

1st Create DB

2nd You need checkit mails with imap (search for "php imap get recent mails")

3rd set up your script in crontab

4th You store whole mail in BLOB content - do not store attachment separately

5th You may load from DB whole letter and work with it

halfer
  • 19,824
  • 17
  • 99
  • 186
Sergey
  • 5,208
  • 25
  • 36