dongzhuifeng1843 2011-11-30 07:58
浏览 108
已采纳

在电子邮件收到时将XML文件导入mysql数据库

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

  • 写回答

1条回答 默认 最新

  • duanna5749 2011-11-30 08:03
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!