C#:从文本中删除电子邮件标题 [英] C#: Remove e-mail header from text
本文介绍了C#:从文本中删除电子邮件标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我在c Sharp中创建了一个控制台应用程序.我想打印某种特定类型的内容(内容类型为纯文本).
我怎样才能做到这一点?该应用程序是访问邮件的pop3服务器.我想这样做是因为我想从要获取的文本中删除电子邮件标题.
谢谢.
Vishavdeep Goyal
解决方案
我认为这链接 [ ^ ]将为您提供帮助.
我不确定为什么要删除它们,但是标题具有简单的格式,您可以在此处找到: ^ ]的RFC编号2045至2049.
基本上,每个标头都与可能的延续行放在单独的行上.空行表示注释已完成,下一行将开始电子邮件正文.但是,您知道如何处理每个部分具有单独的MIME声明的多部分电子邮件吗?您肯定需要这样做,因为您想通过自己的代码来解析电子邮件,但这比仅剥离电子邮件标题要困难得多.
—SA
Hello,
I have created a console application in c sharp. I want to print a particular type of content like (content type is text plain).
How can I do this? The application is a pop3 server accessing mail. I want to do this because i want to remove email header from the text i am getting.
Thanks.
Vishavdeep Goyal
解决方案
I think this Link[^] will help you.
I''m not sure why you need to strip them, but the headers has simple format you can find here: http://www.ietf.org/rfc.html[^] by RFC numbers 2045 to 2049.
Basically, each header goes on a separate line with possible continuation lines. An empty line signals that comments are finishes and the next line will start the e-mail body. However, do you know how to deal with multipart emails with separate MIME declaration for each part? You certainly need this is you want to parse e-mails by your own code, but this is way more difficult than just the strip of the e-mail headers.
—SA
这篇关于C#:从文本中删除电子邮件标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文