Getting emails into PHP web server
I want an easy way to get my email (using Mac Mail or Outlook) to a web server using Apache/PHP to be processed and added to an archive, a database. Is there an easy way to do this? Right开发者_开发问答 now, it seems my best option is to save to disk, open up a page on the site, and upload the email like a file. Is there a better way?
If you want to do it as one off, saving and uploading will probably be the easiest solution.
If you want to do it continually, you might want to look into piping email into php Email piping with php script
Alternatively you can check an IMAP/POP3 mailbox from PHP.
You could create a cron script to automatically scan a specific directory on your webserver daily (or even hourly) to load the files into a db. You would still have to copy them to the webserver manually.
I'm sure there is a better way than that though.
If your aim is ultimately to archive your mail store and even better have your mail flowing to the archive in real-time (e.g once the mails are older than a certain age) then this tool will support your needs. Outlook Mac Archive Tool! calls it Cloud Archive and allows for mail to be stored in mail clouds like Gmail.
The advantage of archiving to a folder in a GMail account is your mail is always accessible through a web interface, searchable and safely backed up in free storage. You could use multiple Gmail accounts if you have excessively large mail stores (e.g. one for each year of mail).
精彩评论