如何使用.Net访问邮件正文部分 [英] How Do I Access Mail Body Part Using .Net

查看:85
本文介绍了如何使用.Net访问邮件正文部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用.net访问邮件正文部分





i使用带有smtp服务器的SQL SERVER 2008 R2。 />




如何为此服务器创建电子邮件/知道电子邮件地址。





我会将我的电子邮件转发到上面的电子邮件地址并想要在gridview中显示。



如何访问邮件正文(例如gmail帐户邮件正文部分)部分使用.Net?

how do i access mail body part using .net


i am using SQL SERVER 2008 R2 which has smtp server.


how to create email /know email address for this server.


I will forward my gmails mail to the above e-address & want to show in gridview.

How Do I Access Mail Body (e.g. gmail account mail body part) Part Using .Net?

推荐答案

每封邮件都只是以特殊方式格式化的纯文本;并且每个部分的格式可以不同于放置在文本文件中的方式(例如base64)。所有这些都受到监管,但是大量的RFC并且非常混乱。此时,您可以使用某些第三方库来解析邮件。我推荐OpenPop:

http://sourceforge.net/projects/hpop [ ^ ]。



其实,这个库写得不是很好,但它在代码中严格遵循标准和引用。它还实现了一个POP客户端。



SQL服务器对电子邮件的概念完全不可知;地址只不过是字符串;所以这部分问题没有意义。



当然,你可以在网格视图中显示每个消息属性。唯一的问题是:哪一个? .NET FCL中有不同的网格视图类型,因此您只需要查看它们的文档,选择适合您应用程序类型的文档并实现您需要的行为。



-SA
Each mail message is nothing but plain text formatted in special ways; and each part can be formatted differently the way fit for placing in text file (such as base64). All together is regulated but a big number of RFCs and is just pretty messy. At this time, you can use some 3rd-party library to parse a mail message. I would recommend OpenPop:
http://sourceforge.net/projects/hpop[^].

Actually, this library in not very well written, but it meticulously follows the standards and references then in the code. It also implements a POP client.

Such thing as SQL server is totally agnostic to the notion of e-mail; the address is nothing but string; so this part of the question does not make sense.

Of course, you can show each message attributes in grid view. The only question is: which one? There are different grid view types in .NET FCL, so you just need to see the documentation on them, choose the one for your application type and implement the behavior you need.

—SA


这篇关于如何使用.Net访问邮件正文部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆