用于解析传入电子邮件、剥离数据并推送到数据库的工具或方法
是否有人使用脚本来解析发送到特定地址的传入电子邮件、删除数据并将其插入 SQL 数据库?
电子邮件将通过 Exchange 2003 服务器传入,并采用已知的固定格式,即
姓名:名字:姓氏 身份证号码:nnnnnnn ETC。 理想情况
下,该解决方案需要在服务器上运行,而不是在客户端上运行。 任何建议表示赞赏。
最初发布在 serverfault 上,但出于脚本角度交叉发布在这里。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,我有。 你想用这个来实现什么目的?
如果您想知道如何解析它,到目前为止我发现的最简单的方法是为不改变的固定格式构建一个简单的抓取器/模式匹配器。
我通常会迭代电子邮件的每一行,寻找特定的元素/标识符,之后我将如此多的字符读取到变量中,以便将行提交到数据库。
SO:
下载所有电子邮件
从服务器删除电子邮件..
Yes I have. What are you trying to accomplish with this?
If you want to know how to parse it, the easiest way I have found so far is to build a simple scraper/pattern matcher for your fixed format that doesn't change.
I generally have iterated though each line of the email looking for a specific element/identifier, after which i read so many characters to a variable for the row to be committed to the database.
SO:
Download all emails
Delete emails from server..