使用 Microsoft SMTP 服务器的 Dropfolder

发布于 2024-08-08 07:20:36 字数 271 浏览 2 评论 0原文

我已经设置了 Microsoft SMTP 服务器,因此它将所有传入电子邮件存储在 dropfolder 中。

我想使用 C# 根据发件人、收件人和主题行处理传入邮件。如果可能的话,我还想创建电子邮件的纯文本预览。

所以,这个问题有两个部分。

  1. 我猜是 FileSystemWatcher 将足以提供 收到邮件的通知。
  2. 如何从 .eml 文件中解析标题和正文;是否有现有的库或有关该格式的任何好的文档?

感谢您的任何帮助。

I have set up Microsoft SMTP server so it will store all incoming email in a dropfolder.

I want to process, using c#, incoming mail based on the sender, recipient, and subject line. If possible, I also want to create a plain text preview of the email.

So, there are two parts to this problem.

  1. I'm guessing a FileSystemWatcher
    would be adequate for providing
    notification of incoming mail.
  2. How to parse the headers and body text from the .eml file; is there an existing library or any good documentation on the format?

Thanks for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独守阴晴ぅ圆缺 2024-08-15 07:20:36
  1. 是的 - 确实如此,
  2. 我用过这个: http:// www.lumisoft.ee/lswww/ENG/Products/Mail_Server/mail_index_eng.aspx?type=info

这是一个用 C# 编写的邮件服务器,带有一个 API,您可以在不使用邮件服务器的情况下使用它

编辑:找到一个代码片段:

LumiSoft.Net.Mime.Mime m = LumiSoft.Net.Mime.Mime.Parse(mailfile);
Console.WriteLine("Read message from: " + m.MainEntity.From);
Console.WriteLine("To: " + m.MainEntity.To[0]);
  1. Yes - thats true
  2. I used this: http://www.lumisoft.ee/lswww/ENG/Products/Mail_Server/mail_index_eng.aspx?type=info

It's a Mailserver written in C# with an API you can use without using the Mailserver

EDIT: Found a code snippet:

LumiSoft.Net.Mime.Mime m = LumiSoft.Net.Mime.Mime.Parse(mailfile);
Console.WriteLine("Read message from: " + m.MainEntity.From);
Console.WriteLine("To: " + m.MainEntity.To[0]);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文