Vb.net - 将outlook msg文件保存到文件夹

问题描述:

是否可以将outlook msg文件保存到文件夹,例如c:\ temp



使用

Dim Smtp_Client作为新的SmtpClient

Dim eMail As New MailMessage()



可以发送电子邮件Smtp_Client。发送(电子邮件)但没有什么可以保存电子邮件



我知道你可以通过Microsoft.Office.Interop.Outlook.Application来做,但需要做SmtpClient。



请帮助



我尝试了什么:



请在互联网上查看任何VB代码示例

Is it possible to save an outlook msg file to a folder e.g. c:\temp

Using
Dim Smtp_Client As New SmtpClient
Dim eMail As New MailMessage()

Can send an email Smtp_Client .Send(eMail) but there is nothing to SaveAs email

I know you can do it via Microsoft.Office.Interop.Outlook.Application but need to do as SmtpClient.

Help please

What I have tried:

Do see any VB code examples on the internet

这样的事情应该有效:

Something like this should work:
Dim Smtp_Client As New SmtpClient
Smtp_Client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory
Smtp_Client.PickupDirectoryLocation = "C:\temp\"

Dim eMail As New MailMessage
...
Smtp_Client.Send(eMail)



邮件将作为 .eml 文件保存在指定目录中,你可以用Outlook打开。


The message will be saved in the specified directory as an .eml file, which you can open with Outlook.