阅读电子邮件内容
希望有人能够提供帮助。我想做的是用 C# 创建一个小型 winform 应用程序,以从 pop 帐户读取电子邮件的内容,并自动将键值上传到 sql。每封电子邮件的电子邮件格式始终相同,例如
名字: 姓 : 电话号码: 等等...
目前电子邮件存储在 pop 3 帐户中,但是我想要一种方法来减少手动将信息键入 sql 的麻烦。
任何人都可以建议我如何去做这件事或者可以推荐一些指南吗?
谢谢。 史蒂夫
Hope someone may be able to help. What i am looking to do is create a small winform app in c# to read the content of a email from a pop account, and upload key values to a sql automatically. The email format is always the same for each email, eg,
First name :
Last name :
Phone number :
etc...
Currently the emails are being stored in a pop 3 account however i want a way to reduce having to key the information into the sql by hand.
Can anyone advise how i would go about doing this or could recommend some guides?
Thanks.
Steve
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议使用这样的类 CodeProject 的 POP3 客户端 来阅读邮件消息。
一旦获得消息内容,您应该能够相当轻松地解析该字符串,因为您知道确切的格式。没有足够的信息来推荐最佳选择 - 这取决于它是否是固定格式、分隔、单独的行等,但使用正则表达式甚至 String.Split 应该使这变得相当简单。
I would recommend using a class like this POP3 client at CodeProject to read the mail messages.
Once you have the message content, you should be able to fairly easily parse the string, since you know the exact format. There isn't enough information to recommend the best option for this - it depends on whether it's fixed format, delimited, separate lines, etc, but using regular expressions or even String.Split should make this fairly simple.
我们使用购买的工具Email2Db 工具来处理传入的电子邮件。它价格便宜且易于配置。我根据我们的需要编写了自定义 vb 脚本,但简单地插入数据库不需要任何编码。
We use a purchased tool Email2Db tool to process incoming email. It is inexpensive and easy to configure. I wrote custom vb scripts for our needs but a simple insert into a db would not require any coding.