【问题标题】:EWS Exchange services place appointment in account without needing to confirmEWS Exchange 服务无需确认即可在账户中进行预约
【发布时间】:2012-11-17 18:16:09
【问题描述】:

每次我进行约会时,它都会转换为会议,因此我调整了我的代码以将约会发送到 SendInvitationsMode.SendToNone,因为我读到当你使用与会者时,它将成为会议,但现在我需要将约会发送到 EmailAdres2没有 EmailAdres2 需要确认我知道这样它会保存在 Emailadres 但我需要它在 EmailAdres2 (Emailadres 拥有向 EmailAdres2 写约会的所有权限)

Dim _service As New ExchangeService(ExchangeVersion.Exchange2010_SP1)
_service.UseDefaultCredentials = False
_service.Credentials = New WebCredentials(Emailadres, Password)
_service.AutodiscoverUrl(EmailAdres2)
_service.TraceEnabled = False
Dim _appointment As New Appointment(_service)
_appointment.Subject = onderwerp

_appointment.Body = "Nieuw Afspraak <br><br> deb_nr en Klant: " & deb_nr & ": " & Label16.Text & " <br> Locatie: " & Label18.Text & " in " & Label17.Text & " <br><br>Omschrijving: " & onderwerp & " <br><br>Telefoon 1: " & tel1 & "<br>Telefoon 2: " & tel2 & "<br>Telefoon 3: " & tel3 & ""

                _appointment.Start = datum
                _appointment.[End] = _appointment.Start.AddHours(endhours)
                _appointment.ReminderMinutesBeforeStart = reminder
                _appointment.Location = Label16.Text & " " & adres
                _appointment.Save(SendInvitationsMode.SendToNone)

您需要为每个电子邮件地址找到正确的文件夹,因此首先像这样连接,然后找到像这样的正确文件夹。

Dim _service As New ExchangeService(ExchangeVersion.Exchange2010_SP1)
_service.UseDefaultCredentials = False
_service.Credentials = New WebCredentials("email", "password")
_service.AutodiscoverUrl("email")

Dim mbox As New Mailbox(email)
Dim folder As New FolderId(WellKnownFolderName.Calendar, mbox)

如果您只发送给 1 个人而不是主要电子邮件地址,请使用 send to none

【问题讨论】:

    标签: vb.net exchangewebservices


    【解决方案1】:

    我认为您需要的是模拟 EmailAdres2 并为其创建约会。 你可以这样做

     _service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, Emailadres2);
    

    注意:您需要从 Exchange 服务器配置中启用 Emailadres2 的模拟。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-31
      • 1970-01-01
      • 1970-01-01
      • 2014-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多