Jump to content

Email message and attachments to mysql?


adrian28uk

Recommended Posts

Is there a way to send an email to a specific address from an email client that would automatically insert the message in plain text to mysql. Could this also be done with attachments as well. I have seen a couple of support tickets systems work like this.

I was wondering if you have any ideas on this?

Thank you

Link to comment
https://forums.phpfreaks.com/topic/20596-email-message-and-attachments-to-mysql/
Share on other sites

two ways:

1. if your smtp server or MTA has a sendtoprogram mode then you could direct the output of the mail handler to a php script.  postfix has such a thing.
2. use php's imap functions to poll your email account from time to time and parse the new email in there.  there are some nice classes in PEAR which will do this for you if your coding skills are not currently up to it.  if you want an example of an application that does this have a look at wordpress's code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.