Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
WebDAV .NET for Exchange
>
Tutorial
> Set voting options
The following example shows you how to send mail message and set voting options.
C# example
using System; using System.Net; using Independentsoft.Webdav.Exchange; using Independentsoft.Webdav.Exchange.ContentClass; namespace Sample { class Program { static void Main(string[] args) { NetworkCredential credential = new NetworkCredential("username", "password"); WebdavSession session = new WebdavSession(credential); session.UserMailbox = "https://myserver/exchange/emailaddress"; Resource resource = new Resource(session); Message message1 = new Message(); message1.Subject = "Test"; message1.Body = "Please vote."; message1.To = "User2@mydomain.com"; message1.VotingOptions = new string[] { "Yes", "No" }; resource.SendMessage(message1); } } }
VB example
Imports System Imports System.Net Imports Independentsoft.Webdav.Exchange Imports Independentsoft.Webdav.Exchange.ContentClass Module Module1 Sub Main(ByVal args() As String) Dim credential As New NetworkCredential("username", "password") Dim session As New WebdavSession(credential) session.UserMailbox = "https://myserver/exchange/emailaddress" Dim resource As New Resource(session) Dim message1 As New Message() message1.Subject = "Test" message1.Body = "Please vote." message1.To = "User2@mydomain.com" message1.VotingOptions = New String() {"Yes", "No"} resource.SendMessage(message1) End Sub End Module