Import XML File into mysql database when received on email

I have an xml file that is emailed to an email address hosted on my web server. I want the ability to import the xml data into my MySQL database as soon as the email is received, thus providing real time updates to my application.

Is this possible and if so how is this acheived. any working scripts or examples would be greatly appreciated.

Thanks and Regards, Ryan


If you want to process it when the eMail is received you have to find out if your eMail server supports any triggers capable of informing your import script. A less live solution would be to have a Cron Job periodically check your mailbox.

PHP has native extensions for accessing IMAP and POP mailboxes. So you just poll the mailbox and if there is a new eMail, you load the xml infile to your database (or do the insert from inside your script by processing it with an XML extension). Make sure you mark the eMail as read, so you dont import it twice.

Need Your Help

How to make a .xib show up in a custom class

iphone xcode uiview interface-builder xib

I was wondering how to connect my custom class and my .xib. In Interface Builder I have changed the class of the Files Owner to my custom class. I then created an IBOutlet and connected it to the v...

Highcharts not referenced error when using setOptions

javascript c# highcharts dotnethighcharts

We are currently using the DotNet.Highcharts API to incorporate Highcharts into our website. However, we are having some JavaScript reference issues when using the .SetOptions(GlobalOptions) call....