问题
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
回答1:
What are you trying to accomplish?
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
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.
回答2:
Introducing the Exchange Web Services Managed API 1.0
http://msdn.microsoft.com/en-us/library/dd633678(EXCHG.80).aspx
来源:https://stackoverflow.com/questions/5175926/how-to-connect-visual-basic-net-with-microsoft-exchange-with-free-libraries-pos