如何将Visual Basic .net与Microsoft Exchange与可能的免费库连接? [英] how to connect visual basic .net with microsoft exchange with free libraries posible?

查看:95
本文介绍了如何将Visual Basic .net与Microsoft Exchange与可能的免费库连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

推荐答案

您要完成什么?

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

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

    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

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

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).aspx for some more information.

这篇关于如何将Visual Basic .net与Microsoft Exchange与可能的免费库连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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