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.

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

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?