vb.net 如何将visual basic .net与microsoft exchange与可能的免费库连接起来?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5175926/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 15:19:05  来源:igfitidea点击:

how to connect visual basic .net with microsoft exchange with free libraries posible?

vb.netexchange-servermapi

提问by PartySoft

Are there any free libraries for VB.net to use for connecting to a MS exchange server? I have found some paid ones but I'd rather not invest, so couln't find any free libraries.. I tried using java as a protocol layer for mapi but it wouldn't work

是否有任何免费的 VB.net 库可用于连接到 MS Exchange 服务器?我找到了一些付费的,但我不想投资,所以找不到任何免费的库..我尝试使用 java 作为 mapi 的协议层,但它不起作用

回答by Rob P.

What are you trying to accomplish?

你想达到什么目的?

I've had no trouble sending mail via my Exchange account using the regular SMTP client

我使用常规 SMTP 客户端通过我的 Exchange 帐户发送邮件没有问题

    Public Shared Sub SendEmail(ByVal sFromAddress As String, _
                            ByVal sToAddress As String, _
                            ByVal sSMTPAddress As String, _
                            ByVal sUsername As String, _
                            ByVal sPassword As String, _
                            ByVal sOrderNo As String, _
                            ByVal sURL As String, _
                            ByVal iPort As Integer)

    Try
        Dim client As New SmtpClient(sSMTPAddress, iPort)
        client.UseDefaultCredentials = False
        client.Credentials = New System.Net.NetworkCredential(sUsername, sPassword)
        client.EnableSsl = True

        Dim mail As New MailMessage
        mail.To.Add(sToAddress)
        mail.From = New MailAddress(sFromAddress)
        mail.Subject = GetSubject(sOrderNo)
        mail.IsBodyHtml = True
        mail.Body = GetBody(sOrderNo, sURL)

        client.Send(mail)

    Catch ex As Exception
        MessageBox.Show("Error Sending E-mail!")
    End Try

End Sub

If you want to have a more meaningful interaction, I know you can accomplish a lot by using Microsoft.Office.Interop.Outlook. Check out http://msdn.microsoft.com/en-us/library/ms268893(VS.80).aspxfor some more information.

如果您想进行更有意义的互动,我知道您可以通过使用Microsoft.Office.Interop.Outlook. 查看http://msdn.microsoft.com/en-us/library/ms268893(VS.80).aspx了解更多信息。

回答by user670052

Introducing the Exchange Web Services Managed API 1.0

介绍 Exchange Web 服务托管 API 1.0

http://msdn.microsoft.com/en-us/library/dd633678(EXCHG.80).aspx

http://msdn.microsoft.com/en-us/library/dd633678(EXCHG.80).aspx