从电子邮件(或数千封电子邮件)中提取数据[基于交换]
我的营销部门,祝福他们,决定进行抽奖活动,让人们通过网页进入。 这很好,但信息不会存储到任何类型的数据库中,而是作为电子邮件发送到交换邮箱。 伟大的。
我的挑战是从这些电子邮件中提取条目(和营销信息)并将其存储在更有用的地方,例如平面文件或 CSV。 唯一的优点是电子邮件具有高度一致的格式。
我确信我可以花时间将所有电子邮件保存到文件中,然后编写一个应用程序来浏览所有电子邮件,但希望有一个更优雅的解决方案。 我可以通过编程方式访问 Exchange 邮箱,阅读所有电子邮件,然后保存该数据吗?
My marketing department, bless them, has decided to make a sweepstakes where people enter over a webpage. That is great but the information isn't stored to a DB of any sort but is sent to an exchange mail box as an email. Great.
My challenge is to extract the entry (and marketing info) from these emails and store them someplace more useful, say a flat file or CSV. The only saving grace is that the emails have a highly consistant format.
I am sure I could spend the time saving all the emails to files and then write an app to munge through them all but was hoping for a much more elegant solution. Can I programmatically access an exchange mailbox, read all the emails and then save that data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我使用的代码......
Here is the code I used....
有很多不同的方法可以获取交换邮箱中的邮件,但由于这似乎是您只想运行一次来提取数据的方法,因此我建议编写一个 VBA 宏在 Outlook 本身内部运行(在 Outlook 中打开相关 Exchange 邮箱)。 遍历特定邮箱中的邮件项目并从中读取正文非常容易。 然后,您可以编写一个包含您想要的内容的文本文件。
There's lots of different ways to get at the messages in an exchange mailbox, but since it seems this is something you're only going to want to run once to extract the data I'd suggest writing a VBA macro to run inside Outlook itself (having opened the exchange mailbox in question within Outlook). It's pretty easy to iterate through the mail items in a specific mailbox and read the body text from them. You can then write a text file with just the stuff you want.