转换多个EML文件单一PST在C# [英] Convert multiple eml files to single PST in C#

查看:410
本文介绍了转换多个EML文件单一PST在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要写这将需要多个EML文件(可能是从一个单一的文件系统文件夹),并将其转换为一个单一的PST文件的单一功能。



这可能吗?如果是有人可以提供的示例代码?



我承担其可能的,因为有很多的商业EML到PST转换器出有这样做的。


< DIV CLASS =h2_lin>解决方案

您可以使用赎回为。沿着线的东西:

 设置会话=的CreateObject(Redemption.RDOSession)
Session.LogonPstStore(C :\temp\test.pst)
组文件夹= Session.GetDefaultFolder(olFolderInbox)
组消息= Folder.Items.Add(IPM.Note的)
Msg.Sent = TRUE
Msg.Import(C:\temp\test.eml,1024)
Msg.Save


I need to write a single function which will take multiple eml files ( may be from a single filesystem folder ) and convert them to a single PST file.

Is it possible? if yes can someone provide a sample code?

I assume its possible because there are many commercial eml to pst converters out there doing this

解决方案

You can use Redemption for that. Something along the lines:

  set Session = CreateObject("Redemption.RDOSession")
  Session.LogonPstStore("c:\temp\test.pst")
  set Folder = Session.GetDefaultFolder(olFolderInbox)
  set Msg = Folder.Items.Add("IPM.Note")
  Msg.Sent = true
  Msg.Import("c:\temp\test.eml", 1024)
  Msg.Save

这篇关于转换多个EML文件单一PST在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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