Every time i make an appointment it gets converted to meeting so i adjusted my code to send the appointment to SendInvitationsMode.SendToNone becase i read when u use attendees it will become an meeting but now i need to get the appointment send to EmailAdres2 without EmailAdres2 needing to confirm i know like this it will be saved at Emailadres but i need it on EmailAdres2
(Emailadres has all privileges to write an appointment to 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)
You need to find the correct folder for each e mail adres so first connect like this and thaen find correct folder like this.
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)
and use send to none if you what so send to only 1 person and not the main e-mail adres
I think what you need is to impersonate the EmailAdres2 and create an appointment for it.
You can do it like this
Note: you need to enable the impersonation for Emailadres2 from the exchange server configuration.