Jump to content


Photo

Email message and attachments to mysql?


  • Please log in to reply
1 reply to this topic

#1 adrian28uk

adrian28uk
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 13 September 2006 - 08:12 AM

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



#2 jpadie

jpadie
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 13 September 2006 - 12:46 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users