Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to Create & Send Email Message with Voting Options inside .NET Apps

sheraz786sheraz786 Posts: 19Member

This technical tip explains how to create & send an email message with voting options inside .NET Applications. Microsoft Outlook allows users to create a poll when composed a new message. This is done by including voting options such as Yes, No, Maybe, etc. The FollowUpOptions class offered by Aspose.Email, provides the VotingButtons property that can be used to set or get the value of the voting options. This article provides a detailed example of creating a MapiMessage with voting options for creating a poll and then sending the message using Exchange Web Service (EWS) client.

Creating and Sending a Message with Voting Options

The following code sample shows how to create a new message and then send it with voting options.

[C#]

string address = "firstname.lastname@aspose.com";

using (IEWSClient client = EWSClient.GetEWSClient("https://exchange.aspose.com/ews/Exchange.asmx", "username", "password", "aspose.com")) { MailMessage message = CreateTestMessage(address);

FollowUpOptions options = new FollowUpOptions();
options.VotingButtons = "Yes;No;Maybe;Exactly!";

client.Send(message, options);

}

[VB.NET]

Dim address As String = "firstname.lastname@aspose.com"

Using client As IEWSClient = EWSClient.GetEWSClient("https://exchange.aspose.com/ews/Exchange.asmx", "username", "password", "aspose.com") Dim message As MailMessage = CreateTestMessage(address)

Dim options As New FollowUpOptions()
options.VotingButtons = "Yes;No;Maybe;Exactly!"

client.Send(message, options)

End Using

Sample Methods Used in Examples

[C#]

private static MailMessage CreateTestMessage(string address) { MailMessage eml = new MailMessage( address, address, "Flagged message", "Make it nice and short, but descriptive. The description may appear in search engines' search results pages...");

return eml;

}

[VB.NET]

private static MailMessage CreateTestMessage(string address) { MailMessage eml = new MailMessage( address, address, "Flagged message", "Make it nice and short, but descriptive. The description may appear in search engines' search results pages...");

return eml;

}

Sign In or Register to comment.