• <tfoot id='vkult'></tfoot>

    <small id='vkult'></small><noframes id='vkult'>

    1. <i id='vkult'><tr id='vkult'><dt id='vkult'><q id='vkult'><span id='vkult'><b id='vkult'><form id='vkult'><ins id='vkult'></ins><ul id='vkult'></ul><sub id='vkult'></sub></form><legend id='vkult'></legend><bdo id='vkult'><pre id='vkult'><center id='vkult'></center></pre></bdo></b><th id='vkult'></th></span></q></dt></tr></i><div id='vkult'><tfoot id='vkult'></tfoot><dl id='vkult'><fieldset id='vkult'></fieldset></dl></div>
      <legend id='vkult'><style id='vkult'><dir id='vkult'><q id='vkult'></q></dir></style></legend>
        • <bdo id='vkult'></bdo><ul id='vkult'></ul>

        发送保存在磁盘上的 eml 文件

        时间:2023-10-05
            • <bdo id='UKoSp'></bdo><ul id='UKoSp'></ul>
                <tbody id='UKoSp'></tbody>

                <legend id='UKoSp'><style id='UKoSp'><dir id='UKoSp'><q id='UKoSp'></q></dir></style></legend>

              1. <i id='UKoSp'><tr id='UKoSp'><dt id='UKoSp'><q id='UKoSp'><span id='UKoSp'><b id='UKoSp'><form id='UKoSp'><ins id='UKoSp'></ins><ul id='UKoSp'></ul><sub id='UKoSp'></sub></form><legend id='UKoSp'></legend><bdo id='UKoSp'><pre id='UKoSp'><center id='UKoSp'></center></pre></bdo></b><th id='UKoSp'></th></span></q></dt></tr></i><div id='UKoSp'><tfoot id='UKoSp'></tfoot><dl id='UKoSp'><fieldset id='UKoSp'></fieldset></dl></div>
                • <small id='UKoSp'></small><noframes id='UKoSp'>

                • <tfoot id='UKoSp'></tfoot>

                  本文介绍了发送保存在磁盘上的 eml 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在创建 eml 并使用 这里.我想知道如何发送这些 eml 文件?我尝试使用 SMTPClient 类的对象,但它将 MailMessage 对象作为其参数,我找不到使用这些保存的 eml 文件创建 MailMessage 类型对象的方法.

                  I am creating eml's and saving them to a directory using procedure mentioned over here. I want to know how to send these eml files? I tried using SMTPClient class's object but it takes MailMessage object as its parameter and I couldn't find and way to create an object of type MailMessage using these saved eml files.

                  推荐答案

                  正确加载 EML 文件并不像看起来那么容易.您可以在几天内编写一个适用于 95% 情况的实现.剩下的 5% 至少需要几个月的时间;-).我知道,因为我参与了开发.

                  Loading an EML file correctly is not as easy as it looks. You can write an implementation working in 95% cases within few days. Remaining 5% would take at least several months ;-). I know, becase I involved in developing one.

                  考虑以下困难:

                  • unicode 电子邮件
                  • 从右到左的语言
                  • 更正由流行邮件客户端和服务器中众所周知的错误导致的格式错误的 EML 文件
                  • 处理 S/MIME(加密和签名的电子邮件)
                  • 正确处理几种编码附件的方法
                  • 处理嵌入到 HTML 电子邮件中的内联图像和样式表
                  • 确保它正确解析 MIME 折磨消息 来自 Mike Crispin(Mime 和 IMAP RFC 的合著者)
                  • 确保格式错误的消息不会导致缓冲区溢出或其他应用程序崩溃
                  • 处理分层消息(带有附加消息的消息)
                  • 确保它能正确处理非常大的电子邮件
                  • unicode emails
                  • right-to-left languages
                  • correcting malformed EML files caused by well known errors in popular mail clients and servers
                  • dealing with S/MIME (encrypted and signed email messages)
                  • dealing correctly with several methods of encoding attachments
                  • dealing with inline images and stylesheets embedded into HTML emails
                  • making sure that it parses correctly a MIME torture message from Mike Crispin (coauthor of Mime and IMAP RFCs)
                  • making sure that malformed message will not result in buffer overun or other application crash
                  • handling hierarchical messages (message with attached messages)
                  • making sure that it handles correctly very big emails

                  这种解析器的成熟需要数年时间,并需要持续不断地为其用户提供反馈.目前 .NET Framework 中还没有这样的解析器.在它改变之前,我建议从一个成熟的供应商那里获得一个第三方 MIME 解析器.

                  Maturing of such parser takes years and continuous feedback for it's users. Right now is no such parser included in the .NET Framework. Until it changes I would sugest getting a thrid party MIME parser from an established vendor.

                  以下代码使用我们的 Rebex Secure Mail 组件,但我确信其他供应商的组件也可以轻松复制类似的任务.

                  Following code uses our Rebex Secure Mail component, but I'm sure that similar task could be replicated easily with components from other vendors as well.

                  代码基于邮件消息教程.

                  // create an instance of MailMessage 
                  MailMessage message = new MailMessage();
                  
                  // load the message from a local disk file 
                  message.Load("c:\message.eml");
                  
                  // send message
                  Smtp.Send(message, "smtp.example.org");
                  

                  这篇关于发送保存在磁盘上的 eml 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:C# SMTP 无法在 Outlook.com 端口 587 上进行身份验证.“服务器响应为:5.7.1 客户端未通过身 下一篇:使用 C# 查找 MX 记录?

                  相关文章

                  • <bdo id='nKSGv'></bdo><ul id='nKSGv'></ul>

                  <small id='nKSGv'></small><noframes id='nKSGv'>

                  1. <i id='nKSGv'><tr id='nKSGv'><dt id='nKSGv'><q id='nKSGv'><span id='nKSGv'><b id='nKSGv'><form id='nKSGv'><ins id='nKSGv'></ins><ul id='nKSGv'></ul><sub id='nKSGv'></sub></form><legend id='nKSGv'></legend><bdo id='nKSGv'><pre id='nKSGv'><center id='nKSGv'></center></pre></bdo></b><th id='nKSGv'></th></span></q></dt></tr></i><div id='nKSGv'><tfoot id='nKSGv'></tfoot><dl id='nKSGv'><fieldset id='nKSGv'></fieldset></dl></div>
                    <tfoot id='nKSGv'></tfoot>

                    1. <legend id='nKSGv'><style id='nKSGv'><dir id='nKSGv'><q id='nKSGv'></q></dir></style></legend>